autodepgraph¶
graph¶
-
class
autodepgraph.graph.AutoDepGraph_DAG(name, cfg_plot_mode='svg', incoming_graph_data=None, **attr)[source]¶ -
-
add_edge(u_of_edge, v_of_edge, **attr)[source]¶ Adds an edge that denotes a dependency in the calibration graph. u_of_edge -> v_of_edge denotes that u depends on v.
-
add_node(node_for_adding, **attr)[source]¶ Adds a node to the graph, including starting attributes.
- attr:
name (type) = default_value
calibrate_function = ‘NotImplementedCalibration’ check_functions = ‘return_fixed_value’ tolerance (float) = 0 timeout (float) = np.inf state (str) = ‘unknown’
-
calibrate_node(node: str, verbose: bool = False)[source]¶ Calibrate specified node
- Parameters
node – Node to calibration
verbose – Verbosity level
- Returns
Returns True if the calibration was succesfull, otherwise False
-
property
cfg_svg_filename¶ Default location for storing svg based visualizations of the DAG.
-
check_node(node, verbose=False)[source]¶ Perform check method on specified node
- Parameters
node – Node to check
verbose – Verbosity level
- Returns
Returns node state after the check
-
maintain_node(node: str, verbose=True) → str[source]¶ - Maintaining a node attempts to go from any state to a good state.
any_state -> good
- Maintain a node performs the following steps:
get the state of the dependency nodes. If all are OK or unknown, perform a check on the node itself. If a node is any other state, execute it to move it to a good state
perform the “check” experiment on the node itself. This quick check
Perform calibration and second round of maintaining dependencies
- Returns
State of the node after maintaining the node
- Raises
Exception if the node could not be calibrated –
-
visualization¶
node_functions¶
-
autodepgraph.node_functions.calibration_functions.test_calibration_False()[source]¶ Dummy calibration function for test cases. Always returns False.
-
autodepgraph.node_functions.calibration_functions.test_calibration_True()[source]¶ Dummy calibration function for test cases. Always returns True.