![]() |
Belle II Software
release-06-00-14
|
Public Member Functions | |
def | __init__ (self, calibration, iov_to_calibrate=None, initial_state="init", iteration=0) |
def | files_containing_iov (self, file_paths, files_to_iovs, iov) |
def | dependencies_completed (self) |
def | automatic_transition (self) |
def | initial_state (self) |
def | initial_state (self, state) |
def | state (self) |
def | state (self, state) |
def | add_state (self, state, enter=None, exit=None) |
def | add_transition (self, trigger, source, dest, conditions=None, before=None, after=None) |
def | __getattr__ (self, name, **kwargs) |
def | get_transitions (self, source) |
def | get_transition_dict (self, state, transition) |
def | save_graph (self, filename, graphname) |
Static Public Member Functions | |
def | default_condition (**kwargs) |
Public Attributes | |
default_states | |
States that are defaults to the CalibrationMachine (could override later) | |
calibration | |
Calibration object whose state we are modelling. | |
iteration | |
Allows calibration object to hold a refernce to the machine controlling it. More... | |
collector_backend | |
Backend used for this calibration machine collector. | |
iov_to_calibrate | |
IoV to be executed, currently will loop over all runs in IoV. | |
root_dir | |
root directory for this Calibration | |
states | |
Valid states for this machine. | |
initial_state | |
Pointless docstring since it's a property. | |
transitions | |
Allowed transitions between states. | |
state | |
Current State of machine. | |
Static Public Attributes | |
string | collector_input_dir = 'collector_input' |
string | collector_output_dir = 'collector_output' |
string | algorithm_output_dir = 'algorithm_output' |
Private Member Functions | |
def | _update_cal_state (self, **kwargs) |
def | _dump_job_config (self) |
def | _recover_collector_jobs (self) |
def | _iov_requested (self) |
def | _resolve_file_paths (self) |
def | _build_iov_dicts (self) |
def | _below_max_iterations (self) |
def | _increment_iteration (self) |
def | _collection_completed (self) |
def | _collection_failed (self) |
def | _runner_not_failed (self) |
def | _runner_failed (self) |
def | _collector_jobs_ready (self) |
def | _submit_collections (self) |
def | _no_require_iteration (self) |
def | _require_iteration (self) |
def | _log_new_state (self, **kwargs) |
def | _make_output_dir (self) |
def | _make_collector_path (self, name, collection) |
def | _make_pre_collector_path (self, name, collection) |
def | _create_collector_jobs (self) |
def | _check_valid_collector_output (self) |
def | _run_algorithms (self) |
def | _prepare_final_db (self) |
def | _trigger (self, transition_name, transition_dict, **kwargs) |
Static Private Member Functions | |
def | _callback (func, **kwargs) |
Private Attributes | |
_algorithm_results | |
Results of each iteration for all algorithms of this calibration. | |
_runner_final_state | |
Final state of the algorithm runner for the current iteration. | |
_collector_timing | |
Times of various useful updates to the collector job e.g. More... | |
_collector_jobs | |
The collector jobs used for submission. | |
_state | |
_initial_state | |
Actual attribute holding initial state for this machine. | |
A state machine to handle `Calibration` objects and the flow of processing for them.
Definition at line 379 of file state_machines.py.
def __init__ | ( | self, | |
calibration, | |||
iov_to_calibrate = None , |
|||
initial_state = "init" , |
|||
iteration = 0 |
|||
) |
Takes a Calibration object from the caf framework and lets you set the initial state.
Definition at line 389 of file state_machines.py.
|
inherited |
Allows us to create a new method for each trigger on the fly. If there is no trigger name in the machine to match, then the normal AttributeError is called.
Definition at line 300 of file state_machines.py.
|
private |
Definition at line 556 of file state_machines.py.
|
private |
Build IoV file dictionary for each collection if required.
Definition at line 533 of file state_machines.py.
|
staticprivateinherited |
Calls a condition/before/after.. function using arguments passed (or not).
Definition at line 336 of file state_machines.py.
|
private |
Did all the collections succeed?
Definition at line 567 of file state_machines.py.
|
private |
Did any of the collections fail?
Definition at line 575 of file state_machines.py.
|
private |
Definition at line 600 of file state_machines.py.
|
private |
Creates a Job object for the collections of this iteration, ready for submission to backend.
Definition at line 722 of file state_machines.py.
|
private |
Dumps the `Job` object for the collections to JSON files so that it's configuration can be recovered later in case of failure.
Definition at line 490 of file state_machines.py.
|
private |
Definition at line 561 of file state_machines.py.
|
private |
Definition at line 518 of file state_machines.py.
|
private |
Definition at line 647 of file state_machines.py.
|
private |
Creates a basf2 path for the correct collector and serializes it in the self.output_dir/<calibration_name>/<iteration>/paths directory
Definition at line 688 of file state_machines.py.
|
private |
Creates the overall root directory of the Calibration. Will not overwrite if it already exists. Also creates s
Definition at line 681 of file state_machines.py.
|
private |
Creates a basf2 path for the collectors setup path (Collection.pre_collector_path) and serializes it in the self.output_dir/<calibration_name>/<iteration>/<colector_output>/<name> directory.
Definition at line 707 of file state_machines.py.
|
private |
Definition at line 623 of file state_machines.py.
|
private |
Take the last iteration's outputdb and copy it to a more easily findable place.
Definition at line 906 of file state_machines.py.
|
private |
Recovers the `Job` object for the collector from a JSON file in the event that we are starting from a reset.
Definition at line 507 of file state_machines.py.
|
private |
Definition at line 634 of file state_machines.py.
|
private |
Definition at line 528 of file state_machines.py.
|
private |
Runs the Calibration Algorithms for this calibration machine. Will run them sequentially locally (possible benefits to using a processing pool for low memory algorithms later on.)
Definition at line 842 of file state_machines.py.
|
private |
Returns: bool: If AlgorithmsRunner failed return True.
Definition at line 590 of file state_machines.py.
|
private |
Returns: bool: If AlgorithmsRunner succeeded return True.
Definition at line 583 of file state_machines.py.
|
private |
Definition at line 616 of file state_machines.py.
|
privateinherited |
Runs the transition logic. Callbacks are evaluated in the order: conditions -> before -> <new state set here> -> after.
Definition at line 312 of file state_machines.py.
|
inherited |
Adds a single state to the list of possible ones. Should be a unique string or a State object with a unique name.
Definition at line 187 of file state_machines.py.
|
inherited |
Adds a single transition to the dictionary of possible ones. Trigger is the method name that begins the transtion between the source state and the destination state. The condition is an optional function that returns True or False depending on the current state/input.
Definition at line 258 of file state_machines.py.
def automatic_transition | ( | self | ) |
Automatically try all transitions out of this state once. Tries fail last.
Definition at line 663 of file state_machines.py.
|
staticinherited |
Method to always return True.
Definition at line 252 of file state_machines.py.
def dependencies_completed | ( | self | ) |
Condition function to check that the dependencies of our calibration are in the 'completed' state. Technically only need to check explicit dependencies.
Definition at line 652 of file state_machines.py.
def files_containing_iov | ( | self, | |
file_paths, | |||
files_to_iovs, | |||
iov | |||
) |
Lookup function that returns all files from the file_paths that overlap with this IoV.
Definition at line 477 of file state_machines.py.
|
inherited |
Returns the transition dictionary for a state and transition out of it.
Definition at line 353 of file state_machines.py.
|
inherited |
Returns allowed transitions from a given state.
Definition at line 342 of file state_machines.py.
|
inherited |
The initial state of the machine. Needs a special property to prevent trying to run on_enter callbacks when set.
Definition at line 203 of file state_machines.py.
|
inherited |
Definition at line 210 of file state_machines.py.
|
inherited |
Does a simple dot file creation to visualise states and transiitons.
Definition at line 364 of file state_machines.py.
|
inherited |
The current state of the machine. Actually a `property` decorator. It will call the exit method of the current state and enter method of the new one. To get around the behaviour e.g. for setting initial states, either use the `initial_state` property or directly set the _state attribute itself (at your own risk!).
Definition at line 221 of file state_machines.py.
|
inherited |
Definition at line 230 of file state_machines.py.
|
private |
Times of various useful updates to the collector job e.g.
start, elapsed, last update Used to periodically call update_status on the collector job and find out an overall number of jobs remaining + estimated remaining time
Definition at line 438 of file state_machines.py.
iteration |
Allows calibration object to hold a refernce to the machine controlling it.
Which iteration step are we in
Definition at line 423 of file state_machines.py.