![]() |
Belle II Software
release-06-00-14
|
Public Member Functions | |
def | __init__ (self, algorithm) |
def | run (self, iov, iteration, queue) |
def | execute_over_boundaries (self, boundary_iovs_to_run_lists, lowest_exprun, highest_exprun, iteration) |
def | execute_runs (self, runs, iteration, iov) |
def | alg_success (self) |
def | setup_from_dict (self, params) |
def | is_valid (self) |
def | find_iov_gaps (self) |
def | any_failed_iov (self) |
def | send_result (self, result) |
def | send_final_state (self, state) |
Public Attributes | |
machine | |
:py:class:caf.state_machines.AlgorithmMachine used to help set up and execute CalibrationAlgorithm It gets setup properly in :py:func:run | |
first_execution | |
queue | |
algorithm | |
Algorithm() class that we're running. | |
input_files | |
Collector output files, will contain all files retured by the output patterns. | |
output_dir | |
The algorithm output directory which is mostly used to store the stdout file. | |
output_database_dir | |
The output database directory for the localdb that the algorithm will commit to. | |
database_chain | |
User defined database chain i.e. More... | |
dependent_databases | |
CAF created local databases from previous calibrations that this calibration/algorithm depends on. | |
ignored_runs | |
Runs that will not be included in ANY execution of the algorithm. More... | |
results | |
The list of results objects which will be sent out before the end. | |
Static Public Attributes | |
dictionary | usable_params |
The params that you could set on the Algorithm object which this Strategy would use. More... | |
list | allowed_granularities = ["run"] |
Granularity of collector that can be run by this algorithm properly. | |
list | required_attrs |
Required attributes that must exist before the strategy can run properly. More... | |
list | required_true_attrs |
Attributes that must have a value that returns True when tested by :py:meth:is_valid . More... | |
string | FINISHED_RESULTS = "DONE" |
Signal value that is put into the Queue when there are no more results left. | |
string | COMPLETED = "COMPLETED" |
Completed state. | |
string | FAILED = "FAILED" |
Failed state. | |
Algorithm strategy to first calculate run boundaries where execution should be attempted. Runs the algorithm over the input data contained within the requested IoV of the boundaries, starting with the first boundary data only. If the algorithm returns 'not enough data' on the current boundary IoV, it won't commit the payloads, but instead adds the next boundarie's data and tries again. Basically the same logic as `SequentialRunByRun` but using run boundaries instead of runs directly. Notice that boundaries cannot span multiple experiments. By default the algorithm will get the payload boundaries directly from the algorithm that need to have inplemented the function ``isBoundaryRequired``. If the desired boundaries are already known it is possible to pass them directly setting the algorithm parameter ``payload_boundaries`` and avoid the need to define the ``isBoundaryRequired`` function. ``payload_boundaries`` is a list ``[(exp1, run1), (exp2, run2), ...]``. A boundary at the beginning of each experiment will be added if not already present. An empty list will thus produce a single payload for each experiment. A ``payload_boundaries`` set to ``None`` is equivalent to not passing it and restores the default behaviour where the boundaries are computed in the ``isBoundaryRequired`` function of the algorithm.
Definition at line 655 of file strategies.py.
def __init__ | ( | self, | |
algorithm | |||
) |
Reimplemented from AlgorithmStrategy.
Definition at line 685 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 153 of file strategies.py.
def execute_over_boundaries | ( | self, | |
boundary_iovs_to_run_lists, | |||
lowest_exprun, | |||
highest_exprun, | |||
iteration | |||
) |
Take the previously found boundaries and the run lists they correspond to and actually perform the Algorithm execution. This is assumed to be for a single experiment.
Definition at line 864 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 133 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 115 of file strategies.py.
def run | ( | self, | |
iov, | |||
iteration, | |||
queue | |||
) |
Runs the algorithm machine over the collected data and fills the results.
Reimplemented from AlgorithmStrategy.
Definition at line 694 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 107 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 89 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 94 of file strategies.py.
|
staticinherited |
Required attributes that must exist before the strategy can run properly.
Base class for Algorithm strategies. These do the actual execution of a single algorithm on collected data. Each strategy may be quite different in terms of how fast it may be, how database payloads are passed between executions, and whether or not final payloads have an IoV that is independent to the actual runs used to calculates them. Parameters: algorithm (:py:class:`caf.framework.Algorithm`): The algorithm we will run This base class defines the basic attributes and methods that will be automatically used by the selected AlgorithmRunner. When defining a derived class you are free to use these attributes or to implement as much functionality as you want. If you define your derived class with an __init__ method, then you should first call the base class `AlgorithmStrategy.__init__()` method via super() e.g. >>> def __init__(self): >>> super().__init__() The most important method to implement is :py:meth:`AlgorithmStrategy.run` which will take an algorithm and execute it in the required way defined by the options you have selected/attributes set.
Some are allowed be values that return False whe tested e.g. "" or []
Definition at line 49 of file strategies.py.
|
staticinherited |
Attributes that must have a value that returns True when tested by :py:meth:is_valid
.
Definition at line 59 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 677 of file strategies.py.