ewokscore.graph.taskgraph.TaskGraph#
- class ewokscore.graph.taskgraph.TaskGraph(source=None, representation=None, **load_options)[source]#
Bases:
object
The API for graph analysis is provided by networkx. Any directed graph is supported (cyclic or acyclic).
Loop over the dependencies of a task
for source in taskgraph.predecessors(target): link_attrs = taskgraph.graph[source][target]
Loop over the tasks dependent on a task
for target in taskgraph.successors(source): link_attrs = taskgraph.graph[source][target]
For acyclic graphs, sequential task execution can be done like this:
taskgraph.execute()
- Parameters:
source (
Union
[str
,Path
,Mapping
,Graph
,None
])representation (
Union
[GraphRepresentation
,str
,None
])
- dump(destination=None, representation=None, **kw)[source]#
- Parameters:
destination (
Union
[str
,Path
,None
])representation (
Union
[GraphRepresentation
,str
,None
])
- Return type:
Union
[str
,Path
,dict
,None
]
- property graph_id: Hashable#
- property graph_label: str#
- property has_conditional_links: bool#
- property is_cyclic: bool#
- load(source=None, representation=None, subgraph_representation=None, **load_options)[source]#
- Parameters:
source (
Union
[str
,Path
,Mapping
,Graph
,None
])representation (
Union
[GraphRepresentation
,str
,None
])subgraph_representation (
Union
[GraphRepresentation
,str
,None
])
- Return type:
None
- property requirements: Sequence[str] | None#