![]() |
Belle II Software development
|
Public Member Functions | |
__init__ (self, calibration_defaults=None) | |
add_calibration (self, calibration) | |
run (self, iov=None) | |
backend (self) | |
backend (self, backend) | |
Public Attributes | |
dict | calibrations = {} |
Dictionary of calibrations for this CAF instance. | |
dict | future_dependencies = {} |
Dictionary of future dependencies of Calibration objects, where the value is all calibrations that will depend on the key, filled during self.run() | |
dict | dependencies = {} |
Dictionary of dependencies of Calibration objects, where value is the list of Calibration objects that the key depends on. | |
str | output_dir = "calibration_results" |
Output path to store results of calibration and bookkeeping information. | |
order = None | |
The ordering and explicit future dependencies of calibrations. | |
int | heartbeat = 5 |
The heartbeat (seconds) between polling for Calibrations that are finished. | |
dict | calibration_defaults = {**self.default_calibration_config, **calibration_defaults} |
Default options applied to each calibration known to the CAF , if the Calibration has these defined by the user then the defaults aren't applied. | |
backend = caf.backends.Local() | |
backend property | |
Static Public Attributes | |
dict | default_calibration_config |
The defaults for Calibrations. | |
Protected Member Functions | |
_remove_missing_dependencies (self) | |
_order_calibrations (self) | |
_check_backend (self) | |
_prune_invalid_collections (self) | |
_make_output_dir (self) | |
_make_database (self) | |
Protected Attributes | |
_backend = None | |
Private backend attribute. | |
_db_path = None | |
The path of the SQLite DB. | |
Static Protected Attributes | |
str | _db_name = "caf_state.db" |
The name of the SQLite DB that gets created. | |
Parameters: calibration_defaults (dict): A dictionary of default options for calibrations run by this `CAF` instance e.g. >>> calibration_defaults={"max_iterations":2} This class holds `Calibration` objects and processes them. It defines the initial configuration/setup for the calibrations. But most of the real processing is done through the `caf.state_machines.CalibrationMachine`. The `CAF` class essentially does some initial setup, holds the `CalibrationBase` instances and calls the `CalibrationBase.start` when the dependencies are met. Much of the checking for consistency is done in this class so that no processing is done with an invalid setup. Choosing which files to use as input should be done from outside during the setup of the `CAF` and `CalibrationBase` instances.
Definition at line 1183 of file framework.py.
__init__ | ( | self, | |
calibration_defaults = None ) |
Definition at line 1209 of file framework.py.
|
protected |
Makes sure that the CAF has a valid backend setup. If one isn't set by the user (or if the one that is stored isn't a valid Backend object) we should create a default Local backend.
Definition at line 1324 of file framework.py.
|
protected |
Creates the CAF status database. If it already exists we don't overwrite it.
Definition at line 1489 of file framework.py.
|
protected |
Creates the output directory. If it already exists we are now going to try and restart the program from the last state. Returns: str: The absolute path of the new output_dir
Definition at line 1470 of file framework.py.
|
protected |
- Uses dependency attributes of calibrations to create a dependency dictionary and passes it to a sorting algorithm. - Returns valid OrderedDict if sort was successful, empty one if it failed (most likely a cyclic dependency)
Definition at line 1280 of file framework.py.
|
protected |
Checks all current calibrations and removes any invalid Collections from their collections list.
Definition at line 1333 of file framework.py.
|
protected |
This checks the future and past dependencies of each `Calibration` in the `CAF`. If any dependencies are not known to the `CAF` then they are removed from the `Calibration` object directly.
Definition at line 1253 of file framework.py.
add_calibration | ( | self, | |
calibration ) |
Adds a `Calibration` that is to be used in this program to the list. Also adds an empty dependency list to the overall dictionary. You should not directly alter a `Calibration` object after it has been added here.
Definition at line 1237 of file framework.py.
backend | ( | self | ) |
The `backend <backends.Backend>` that runs the collector job. When set, this is checked that a `backends.Backend` class instance was passed in.
Definition at line 1454 of file framework.py.
backend | ( | self, | |
backend ) |
Definition at line 1462 of file framework.py.
run | ( | self, | |
iov = None ) |
Keyword Arguments: iov(`caf.utils.IoV`): IoV to calibrate for this processing run. Only the input files necessary to calibrate this IoV will be used in the collection step. This function runs the overall calibration job, saves the outputs to the output_dir directory, and creates database payloads. Upload of final databases is not done here. This simply creates the local databases in the output directory. You should check the validity of your new local database before uploading to the conditions DB via the basf2 tools/interface to the DB.
Definition at line 1347 of file framework.py.
|
protected |
Private backend attribute.
Definition at line 1225 of file framework.py.
|
staticprotected |
The name of the SQLite DB that gets created.
Definition at line 1202 of file framework.py.
|
protected |
The path of the SQLite DB.
Definition at line 1235 of file framework.py.
backend = caf.backends.Local() |
backend property
Definition at line 1331 of file framework.py.
calibration_defaults = {**self.default_calibration_config, **calibration_defaults} |
Default options applied to each calibration known to the CAF
, if the Calibration
has these defined by the user then the defaults aren't applied.
A simple way to define the same configuration to all calibrations in the CAF
.
Definition at line 1233 of file framework.py.
dict calibrations = {} |
Dictionary of calibrations for this CAF
instance.
You should use add_calibration
to add to this.
Definition at line 1213 of file framework.py.
|
static |
The defaults for Calibrations.
Definition at line 1204 of file framework.py.
dict dependencies = {} |
Dictionary of dependencies of Calibration
objects, where value is the list of Calibration
objects that the key depends on.
This attribute is filled during self.run()
Definition at line 1219 of file framework.py.
dict future_dependencies = {} |
Dictionary of future dependencies of Calibration
objects, where the value is all calibrations that will depend on the key, filled during self.run()
Definition at line 1216 of file framework.py.
heartbeat = 5 |
The heartbeat (seconds) between polling for Calibrations that are finished.
Definition at line 1227 of file framework.py.
order = None |
The ordering and explicit future dependencies of calibrations.
Will be filled during CAF.run()
for you.
Definition at line 1223 of file framework.py.
output_dir = "calibration_results" |
Output path to store results of calibration and bookkeeping information.
Definition at line 1221 of file framework.py.