![]() |
Belle II Software
release-06-01-15
|
Public Member Functions | |
def | __init__ (self, calibration_defaults=None) |
def | add_calibration (self, calibration) |
def | run (self, iov=None) |
def | backend (self) |
def | backend (self, backend) |
Public Attributes | |
calibrations | |
Dictionary of calibrations for this CAF instance. More... | |
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() | |
dependencies | |
Dictionary of dependencies of Calibration objects, where value is the list of Calibration objects that the key depends on. More... | |
output_dir | |
Output path to store results of calibration and bookkeeping information. | |
order | |
The ordering and explicit future dependencies of calibrations. More... | |
heartbeat | |
The heartbeat (seconds) between polling for Calibrations that are finished. | |
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. More... | |
backend | |
backend property | |
Static Public Attributes | |
dictionary | default_calibration_config |
The defaults for Calibrations. More... | |
Private Member Functions | |
def | _remove_missing_dependencies (self) |
def | _order_calibrations (self) |
def | _check_backend (self) |
def | _prune_invalid_collections (self) |
def | _make_output_dir (self) |
def | _make_database (self) |
Private Attributes | |
_backend | |
Private backend attribute. | |
_db_path | |
The path of the SQLite DB. | |
Static Private Attributes | |
string | _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 1158 of file framework.py.
def __init__ | ( | self, | |
calibration_defaults = None |
|||
) |
Definition at line 1184 of file framework.py.
|
private |
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 1299 of file framework.py.
|
private |
Creates the CAF status database. If it already exists we don't overwrite it.
Definition at line 1464 of file framework.py.
|
private |
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 1445 of file framework.py.
|
private |
- Uses dependency atrributes of calibrations to create a dependency dictionary and passes it to a sorting algorithm. - Returns valid OrderedDict if sort was succesful, empty one if it failed (most likely a cyclic dependency)
Definition at line 1255 of file framework.py.
|
private |
Checks all current calibrations and removes any invalid Collections from their collections list.
Definition at line 1308 of file framework.py.
|
private |
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 1228 of file framework.py.
def 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 1212 of file framework.py.
def 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 1429 of file framework.py.
def backend | ( | self, | |
backend | |||
) |
Definition at line 1437 of file framework.py.
def 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 1322 of file framework.py.
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 1208 of file framework.py.
calibrations |
Dictionary of calibrations for this CAF
instance.
You should use add_calibration
to add to this.
Definition at line 1188 of file framework.py.
|
static |
The defaults for Calibrations.
Definition at line 1179 of file framework.py.
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 1194 of file framework.py.
order |
The ordering and explicit future dependencies of calibrations.
Will be filled during CAF.run()
for you.
Definition at line 1198 of file framework.py.