eolearn.core.eonode

This module implements the EONode class, which specifies the local dependencies of an EOWorkflow

class eolearn.core.eonode.EONode(task, inputs=<factory>, name=None)[source]

Bases: object

Class representing a node in EOWorkflow graph.

The object id is kept to help with serialization issues. Tasks created in different sessions have a small chance of having an id clash. For this reason all tasks of a workflow should be created in the same session.

Parameters
Return type

None

task: eolearn.core.eotask.EOTask
inputs: Sequence[eolearn.core.eonode.EONode]
name: Optional[str] = None
uid: str
get_name(suffix_number=0)[source]

Provides node name according to the class of the contained task and a given number.

Parameters

suffix_number (int) –

Return type

str

get_dependencies(*, _memo=None)[source]

Returns a set of nodes that this node depends on. Set includes the node itself.

Parameters

_memo (Optional[Dict[eolearn.core.eonode.EONode, Set[eolearn.core.eonode.EONode]]]) –

Return type

Set[eolearn.core.eonode.EONode]

eolearn.core.eonode.linearly_connect_tasks(*tasks)[source]

Creates a list of linearly linked nodes, suitable to construct an EOWorkflow.

Nodes depend on each other in such a way, that the node containing the task at index i is the input node for the node at index i+1. Nodes are returned in the order of execution, so the task at index j is contained in the node at index j, making it easier to construct execution arguments.

Parameters

tasks (Union[eolearn.core.eotask.EOTask, Tuple[eolearn.core.eotask.EOTask, str]]) – A sequence containing tasks and/or (task, name) pairs

Return type

List[eolearn.core.eonode.EONode]

class eolearn.core.eonode.NodeStats(node_uid, node_name, start_time, end_time, exception=None, exception_traceback=None)[source]

Bases: object

An object containing statistical info about a node execution.

Parameters
Return type

None

node_uid: str
node_name: str
start_time: datetime.datetime
end_time: datetime.datetime
exception: Optional[BaseException] = None
exception_traceback: Optional[str] = None