RunDB

The RunDB allows to store a hierarchy of objects describing experiments. The objects are:

  • Acquisitions: A simple data acquisition with inmutable characteristics during its duration
  • Runs: A group of acquisitions. Typically generated by a script that cycles the configuration of the experimental device and generates an acquisition for each configuration.
  • Run groups: a group of runs.

The RunDB has a hierarchical structure. Each object contains a name, a mount point (mp) and a path, and it belongs to a parent object. The path of the object is relative to its mount point. For example, an object with mp=file:/// and path=home/data will have its files is /home/data. On the other hand an object with mp=nfs://server/nfs and path=myobject will have its data in the folder myobject of the corresponding NFS mount point.

The new_run_group, new_run, new_acq functions return a unique id of each object with the names of each object in the hierarchy, separated by slashes. For example: root/my_run_group/my_run/my_acquisition.

Examples: We have a top level run group called commissioning that contains a second level run group called first_tests. Inside it, we have a run called calibration_1 and an acquisition called iteration_1/threshold_200 (note that acquisition names can contain further filesystem levels). All of them with a mount point file:///

  • id of the run groups: root/commissioning/first_tests and root/commissioning
  • id of the run: root/commissioning/first_tests/calibration_1
  • id of the acquisition: root/commissioning/first_tests/calibration_1/iteration_1/threshold_200

API

cmd_rundb.init(*uri)[source]

Initialize server connection based on list uri. This function is called with the arguments from the command line call to cmdmod. If not provided, the default value of the database engine is used. Databases are created if non-existant.

cmd_rundb.new_acq_rundb(name, mp, path, run_id, mode='append')[source]

Add an acquisition in run_id.

cmd_rundb.new_run_rundb(name, mp, path, run_g_id, mode='append')[source]

Add new run with name, in run group run_g_id.

cmd_rundb.new_run_group_rundb(name, mp, path, run_g_id, mode='append')[source]

Add new run group with name, in run group run_g_id.

cmd_rundb.del_acq_rundb(acq_id)[source]

Remove acquisition acq_id.

cmd_rundb.del_run_rundb(run_id, recursive)[source]

Remove run run_id.

cmd_rundb.del_run_group_rundb(run_g_id, recursive)[source]

Remove run group run_g_id.

cmd_rundb.set_param_acq_rundb(acq_id, name, value)[source]

Set parameter (name, value) to acq_id.

cmd_rundb.set_param_run_rundb(run_id, name, value)[source]

Set parameter (name, value) to run_id.

cmd_rundb.set_xml_params_acq_rundb(acq_id, xml_file, add_parent)[source]

Parse XML data from xml_file and include it in acq_id.

cmd_rundb.get_acq_rundb(acq_id)[source]

Get acquisition parameters and values of acq_id separated by a tab. One line for each parameter. The result is returned encoded in base64.

cmd_rundb.get_run_rundb(run_id)[source]

Get run parameters and values of run_id separated by a tab. One line for each parameter. The result is returned encoded in base64.

cmd_rundb.get_run_group_rundb(run_g_id)[source]

Get run group parameters and values of run_g_id separated by a tab. One line for each parameter. The result is returned encoded in base64.

cmd_rundb.get_params_acq_rundb(acq_id)[source]

Get a list of parameters defined for acq_id.

cmd_rundb.get_param_acq_rundb(acq_id, param)[source]

Get value of param in acq_id.

cmd_rundb.get_param_run_rundb(run_id, param)[source]

Get value of param in run_id.

cmd_rundb.get_acqs_regex_rundb(key_regex, value_regex)[source]

Get a list of acquisitions where the key matches the regular expression key_regex and/or the value matches value_regex.

cmd_rundb.get_acqs_table_regex_rundb(key_regex, value_regex)[source]

Get a list of acquisitions where the key matches the regular expression key_regex and/or the value matches value_regex. Return a tab-separated list with the acq name, the found key and the found value. One line for each result. Result is return encoded in Base64

cmd_rundb.get_acqs_script_rundb(map_func, red_func, group)[source]

Get a list of acquisitions using the map and reduce functions map_func and red_func, respectively. red_func and group can be “none” to not be sent.

cmd_rundb.get_acqs_in_run_rundb(run_id, return_ids='1')[source]

Get acquisitions in run. The returned list can be id’s or names depending on return_ids

cmd_rundb.get_runs_in_run_group_rundb(run_g_id)[source]

Get runs in run group run_g_id.

cmd_rundb.get_run_groups_in_run_group_rundb(run_g_id, recursive='false')[source]

Get run groups in run group run_g_id. Nested run groups are also returned if recursive is true or 1 (case-insensitive)

cmd_rundb.get_acq_name_rundb(acq_id)[source]

Get acq name from acq_id.

cmd_rundb.get_run_name_rundb(run_id)[source]

Get run name from run_id.

cmd_rundb.get_run_group_name_rundb(run_g_id)[source]

Get run name from run_g_id.

cmd_rundb.is_empty_run_rundb(run_id)[source]

Check if run run_id is empty.

cmd_rundb.is_empty_run_group_rundb(run_g_id)[source]

Check if run group run_g_id is empty.

cmd_rundb.check_acq_id_rundb(acq_id)[source]

Check existance of acq_id.

cmd_rundb.check_run_id_rundb(run_id)[source]

Check existance of run_id

cmd_rundb.check_run_g_id_rundb(run_g_id)[source]

Check existance of run_g_id