pydevDAG._structure._utils module — pydevDAG 1.0 documentation

### Navigation

- index
- modules |
- next |
- previous |
- pydevDAG 1.0 documentation »
- pydevDAG »
- pydevDAG package »
- pydevDAG._structure package »

# pydevDAG._structure._utils module

## pydevDAG._structure._utils

Utilities for graph building.

class `pydevDAG._structure._utils.` `GraphMethods`

  Bases: `object`

  Generic graph methods.

  classmethod `add_edges`(graph, sources, targets, edge_type, source_node_type, target_node_type, edge_attributes=None)

    Add edges to graph from sources to targets.

    Parameters: | graph (DiGraph) – the graph sources (list of object) – source nodes targets (list of object) – target nodes edge_type (EdgeType) – type for edges source_node_type (NodeType) – type for source nodes target_node_type (NodeType) – type for target nodes edge_attributes (dict of str * object or NoneType) – dict of edge attributes (default None)

  classmethod `add_nodes`(graph, nodes, node_type)

    Add nodes in `nodes` to graph.

    Parameters: | graph (DiGraph) – the graph nodes (list of object) – source nodes node_type (NodeType) – a node type

    Nodes are device_paths of each device, as these uniquely identify the device.

  static `get_node_args`(nodes, node_type)

    Get node arguments, along with keys.

    Parameters: | nodes (list of object) – source nodes node_type (NodeType) – a node type
    Returns: | arguments suitable for passing to add_nodes_from()

### Navigation

- index
- modules |
- next |
- previous |
- pydevDAG 1.0 documentation »
- pydevDAG »
- pydevDAG package »
- pydevDAG._structure package »