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()
dump(destination=None, representation=None, **kw)[source]#
Parameters:

representation (Union[GraphRepresentation, str, None]) –

Return type:

Union[str, dict, None]

execute(*args, **kw)[source]#
property graph_id: Hashable#
property graph_label: str#
property is_cyclic: bool#
load(source=None, representation=None, subgraph_representation=None, **load_options)[source]#
Parameters:
Return type:

None

serialize()[source]#
Return type:

str