plynx.utils.node_utils

This module contais utils related to plynx.db.Node, but not necessary involved into DB structure

Module Contents

plynx.utils.node_utils.node_collection_managers[source]
class plynx.utils.node_utils._GraphVertex[source]

Used for internal purposes.

exception plynx.utils.node_utils.GraphError[source]

Bases: Exception

Generic Graph topology exception

plynx.utils.node_utils._generate_parameters_key(node: Node) → str[source]

Generate hash key based on parameters only.

Args:
node (Node): Node object
Return:
(str) Hash value
plynx.utils.node_utils.node_inputs_and_params_are_identical(subnode: Node, other_subnode: Node) → bool[source]

Check if two nodes are identical in terms of inputs and parameters

plynx.utils.node_utils.augment_node_with_cache(node: Node, other_node: Node) → None[source]

Augment the Node in templates with a Node in Run. Results will be stored in _cached_node fields of the subnodes and not applied directly.

plynx.utils.node_utils.traverse_reversed(node: Node)[source]

Traverse the subnodes in a reversed from the topoligical order.

plynx.utils.node_utils.traverse_in_order(node: Node)[source]

Traverse the subnodes in a topoligical order.

plynx.utils.node_utils.arrange_auto_layout(node: Node, readonly: bool = False)[source]

Use heuristic to rearange nodes.

plynx.utils.node_utils.apply_cache(node: Node)[source]

Apply cache values to outputs and logs

plynx.utils.node_utils.construct_new_run(node: Node, user_id) → Tuple[Optional[Node], Node][source]

Create a new run based on a Node itself and the latest run as well.

plynx.utils.node_utils.remove_auto_run_disabled(node: Node)[source]

Trim the subnodes the way that if there is no need to run a subnode and it is not auto runnable, ignore it.

plynx.utils.node_utils.calc_status_to_node_ids(node: Optional[Node]) → Dict[str, Set[ObjectId]][source]

Make a map node_running_status to list of ids.

plynx.utils.node_utils.reset_nodes(node: Node)[source]

Reset statuses of the sub-nodes as well as logs and outputs

plynx.utils.node_utils.traverse_left_join(node: Node, other_node: Node)[source]

Traverse two nodes in order and yield pairs of subnodes with the same _id.