gemseo.core.execution_status module#

Execution status of processes.

class ExecutionStatus(process_name)[source]#

Bases: Serializable

Execution status of a process.

The status aims at monitoring a process and give the user a simplified view on the state of the processes.

The possible statuses are defined in Status. The status rules are: - the initial status is DONE, - the status RUNNING or LINEARIZING can only be set when the current one is

DONE,

  • the status DONE can only be set when the current one is RUNNING.

Helper methods should be used to handle the statuses when running or linearizing a process: run() and linearize().

Observers can be attached and are notified when the value of the status is changed. The observers are not restored after pickling.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

process_name (str) -- The name of the process.

class Status(value)[source]#

Bases: StrEnum

The statuses.

DONE = 'DONE'#
FAILED = 'FAILED'#
LINEARIZING = 'LINEARIZING'#
RUNNING = 'RUNNING'#
add_observer(observer)[source]#

Add an observer.

Parameters:

observer (BaseExecutionStatusObserver) -- The observer to add.

Return type:

None

linearize()[source]#

Set the status to LINEARIZING while executing code.

On exception, the status is set to FAILED, otherwise is set to DONE.

Return type:

Iterator[None]

remove_observer(observer)[source]#

Remove an observer.

Parameters:

observer (BaseExecutionStatusObserver) -- The observer to remove.

Return type:

None

run()[source]#

Set the status to RUNNING while executing code.

On exception, the status is set to FAILED, otherwise is set to DONE.

Return type:

Iterator[None]

property value: Status#

The status of the process.