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:
  • task (EOTask) – An instance of EOTask that is carried out at the node when executed

  • inputs (Sequence[EONode]) – A sequence of EONode instances whose results this node takes as input

  • name (str | None) – Custom name of the node

task: EOTask
inputs: Sequence[EONode]
name: str | None = 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 (dict[eolearn.core.eonode.EONode, set[eolearn.core.eonode.EONode]] | None) –

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 (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_info=None)[source]

Bases: object

An object containing statistical info about a node execution.

Parameters:
  • node_uid (str) –

  • node_name (str) –

  • start_time (datetime) –

  • end_time (datetime) –

  • exception_info (ExceptionInfo | None) –

node_uid: str
node_name: str
start_time: datetime
end_time: datetime
exception_info: ExceptionInfo | None = None
class eolearn.core.eonode.ExceptionInfo(exception, traceback, origin)[source]

Bases: object

Contains information on exceptions that occur when executing a node.

Parameters:
  • exception (BaseException) –

  • traceback (str) –

  • origin (str) –

exception: BaseException
traceback: str
origin: str