CalibrationNode

class CalibrationNode(calibration_graph, calibration_function, name, timeout=None, check_data_function=None)

A node in the calibration graph, wrapping a calibration function.

Parameters

  • calibration_graph (CalibrationGraph) – The graph this node belongs to.
  • calibration_function (Callable [ [CalibrationGraph ] , CalibrationStatus ]) – The callable that runs the calibration. The exact form of this function can vary a lot depending on the architecture that the calibration will run on, so don’t assume anything about the function other than its input parameters and output return type.
  • name (str) – The name of the node.
  • timeout (float or None , optional) – The time (in seconds) after which this calibration has to be redone, typically due to system drifts. If provided, must be greater than zero. Defaults to None, in which case the the node doesn’t time out.
  • check_data_function (Callable [ [CalibrationGraph ] , CheckDataStatus ] or None , optional) – The callable that runs the experiment to check data. This is an experiment to check if the calibration is capable of succeeding under the present conditions, and should be faster than a full calibration. The exact form of this form can vary depending on the architecture, so we don’t assume anything besides the input and output types. If not provided, the calibration function is used to check data, if it is safe to run it (that is, if all the dependencies are in SUCCESS status). If that is not the case, it fails.

Attributes

nameReturn the name of the node.

Methods

calibrateRun the provided calibration function.
check_dataRun the provided function to run the experiment to check the data.
check_if_timed_outCheck whether the current node was last calibrated longer ago than the timeout period.
get_statusGet the status of the node, indicating whether the calibration has been run already, and whether it has succeeded.
in_graphCheck if this node belongs to the graph provided.
time_since_last_calibrationReturn the time since the last calibration was successful.

Was this useful?