![]() |
Belle II Software development
|
Public Member Functions | |
__init__ (self, algorithm) | |
run (self, iov, iteration, queue) | |
setup_from_dict (self, params) | |
is_valid (self) | |
find_iov_gaps (self) | |
any_failed_iov (self) | |
send_result (self, result) | |
send_final_state (self, state) | |
Public Attributes | |
machine = AlgorithmMachine(self.algorithm) | |
:py:class:caf.state_machines.AlgorithmMachine used to help set up and execute CalibrationAlgorithm It gets setup properly in :py:func:run | |
algorithm = algorithm | |
Algorithm() class that we're running. | |
list | input_files = [] |
Collector output files, will contain all files returned by the output patterns. | |
str | output_dir = "" |
The algorithm output directory which is mostly used to store the stdout file. | |
str | output_database_dir = "" |
The output database directory for the localdb that the algorithm will commit to. | |
list | database_chain = [] |
User defined database chain i.e. | |
list | dependent_databases = [] |
CAF created local databases from previous calibrations that this calibration/algorithm depends on. | |
list | ignored_runs = [] |
Runs that will not be included in ANY execution of the algorithm. | |
list | results = [] |
The list of results objects which will be sent out before the end. | |
queue = None | |
The multiprocessing Queue we use to pass back results one at a time. | |
Static Public Attributes | |
dict | usable_params = {} |
The params that you could set on the Algorithm object which this Strategy would use. | |
list | required_attrs |
Required attributes that must exist before the strategy can run properly. | |
list | required_true_attrs |
Attributes that must have a value that returns True when tested by :py:meth:is_valid . | |
list | allowed_granularities = ["run", "all"] |
Granularity of collector that can be run by this algorithm properly. | |
str | FINISHED_RESULTS = "DONE" |
Signal value that is put into the Queue when there are no more results left. | |
str | COMPLETED = "COMPLETED" |
Completed state. | |
str | FAILED = "FAILED" |
Failed state. | |
Algorithm strategy to do run-by-run calibration of collected data. Runs the algorithm over the input data contained within the requested IoV, starting with the first run's data only. This strategy differs from `SequentialRunByRun` in that it *will not merge run data* if the algorithm returns 'not enough data' on the current run. Once an execution on a run returns *any* result 'iterate', 'ok', 'not_enough_data', or 'failure', we move onto the next run (if any are left). Committing of payloads to the outputdb only happens for 'iterate' or 'ok' return codes. .. important:: Unlike most other strategies, this one won't immediately fail and return if a run returns a 'failure' exit code. The failure will prevent iteration/successful completion of the CAF though. .. warning:: Since this strategy doesn't try to merge data from runs, if *any* run in your input data doesn't contain enough data to complete the algorithm successfully, you won't be able to get a successful calibration. The CAF then won't allow you to iterate this calibration, or pass the constants onward to another calibration. However, you will still have the database created that covers all the successful runs. This uses a `caf.state_machines.AlgorithmMachine` to actually execute the various steps rather than operating on a CalibrationAlgorithm C++ class directly.
Definition at line 541 of file strategies.py.
__init__ | ( | self, | |
algorithm ) |
Definition at line 571 of file strategies.py.
|
inherited |
Returns: bool: If any result in the current results list has a failed algorithm code we return True
Definition at line 152 of file strategies.py.
|
inherited |
Finds and prints the current gaps between the IoVs of the strategy results. Basically these are the IoVs not covered by any payload. It CANNOT find gaps if they exist across an experiment boundary. Only gaps within the same experiment are found. Returns: iov_gaps(list[IoV])
Definition at line 132 of file strategies.py.
|
inherited |
Returns: bool: Whether or not this strategy has been set up correctly with all its necessary attributes.
Definition at line 114 of file strategies.py.
run | ( | self, | |
iov, | |||
iteration, | |||
queue ) |
Runs the algorithm machine over the collected data and fills the results.
Reimplemented from AlgorithmStrategy.
Definition at line 579 of file strategies.py.
|
inherited |
send final state
Definition at line 176 of file strategies.py.
|
inherited |
send result
Definition at line 172 of file strategies.py.
|
inherited |
Parameters: params (dict): Dictionary containing values to be assigned to the strategy attributes of the same name.
Definition at line 106 of file strategies.py.
|
inherited |
Algorithm() class that we're running.
Definition at line 80 of file strategies.py.
|
staticinherited |
Granularity of collector that can be run by this algorithm properly.
Definition at line 65 of file strategies.py.
|
staticinherited |
Completed state.
Definition at line 71 of file strategies.py.
|
inherited |
User defined database chain i.e.
the default global tag, or if you have localdb's/tags for custom alignment etc
Definition at line 88 of file strategies.py.
|
inherited |
CAF created local databases from previous calibrations that this calibration/algorithm depends on.
Definition at line 90 of file strategies.py.
|
staticinherited |
Failed state.
Definition at line 74 of file strategies.py.
|
staticinherited |
Signal value that is put into the Queue when there are no more results left.
Definition at line 68 of file strategies.py.
|
inherited |
Runs that will not be included in ANY execution of the algorithm.
Usually set by Calibration.ignored_runs. The different strategies may handle the resulting run gaps differently.
Definition at line 93 of file strategies.py.
|
inherited |
Collector output files, will contain all files returned by the output patterns.
Definition at line 82 of file strategies.py.
machine = AlgorithmMachine(self.algorithm) |
:py:class:caf.state_machines.AlgorithmMachine
used to help set up and execute CalibrationAlgorithm It gets setup properly in :py:func:run
Definition at line 577 of file strategies.py.
|
inherited |
The output database directory for the localdb that the algorithm will commit to.
Definition at line 86 of file strategies.py.
|
inherited |
The algorithm output directory which is mostly used to store the stdout file.
Definition at line 84 of file strategies.py.
|
inherited |
The multiprocessing Queue we use to pass back results one at a time.
Definition at line 97 of file strategies.py.
|
staticinherited |
Required attributes that must exist before the strategy can run properly.
Some are allowed be values that return False when tested e.g. "" or []
Definition at line 48 of file strategies.py.
|
staticinherited |
Attributes that must have a value that returns True when tested by :py:meth:is_valid
.
Definition at line 58 of file strategies.py.
|
inherited |
The list of results objects which will be sent out before the end.
Definition at line 95 of file strategies.py.
|
static |
The params that you could set on the Algorithm object which this Strategy would use.
Just here for documentation reasons.
Definition at line 569 of file strategies.py.