mafw.enumerators

Module provides a set of enumerators for dealing with standard tasks.

Classes

LogicalOp(value)

Enumeration of supported logical operations.

LoopType(value)

The loop strategy for the processor.

LoopingStatus(value)

Enumerator to modify the looping cycle.

ProcessorExitStatus(value)

The processor exit status enumerator class

ProcessorStatus(value)

Enumerator to describe the status of a processor.

class mafw.enumerators.LogicalOp(value)[source]

Bases: Enum

Enumeration of supported logical operations.

Added in version 1.3.0.

class mafw.enumerators.LoopType(value)[source]

Bases: StrEnum

The loop strategy for the processor.

Each processor can be executed in one of the following modes:

  1. Single mode. The process method is executed only once.

  2. For loop mode. The process method is executed inside a for loop after the start and before the finish. The loop is based on a list of elements, the user must overload the get_items() method to define the list of items for the loop.

  3. While loop mode. The process method is executed inside a while loop after the start and before the finish. The user must overload the while_condition() to define when to stop the loop.

Future development

Implement concurrent loop. Depending on the development of the free-threading capabilities of future python releases, this concurrent looping strategy might be based on threads or a porting of the autorad multi-processor approach.

_generate_next_value_(start, count, last_values)

Return the lower-cased version of the member name.

ForLoop = 'for_loop'

Value for the for loop on item list execution.

SingleLoop = 'single'

Value for the single mode execution.

WhileLoop = 'while_loop'

Value for the while loop execution.

class mafw.enumerators.LoopingStatus(value)[source]

Bases: IntEnum

Enumerator to modify the looping cycle.

In the case of a looping Processor, the user has the ability to slightly modify the looping structure using this enumerator.

In the process() the user can set the variable looping_status to one of the following values:

The last two options are apparently identical, but they offer the possibility to implement a different behaviour in the finish() method. When abort is used, then the AbortProcessorException will be raised. For example, the user can decide to rollback all changes if an abort as occurred or to save what done so far in case of a quit.

Abort = 3

Break the loop and force the outside container (mafw.processor.ProcessorList) to quit.

Continue = 1

The loop can continue

Quit = 4

Break the loop but let the outside container (mafw.processor.ProcessorList) to continue.

Skip = 2

Skip this item.

class mafw.enumerators.ProcessorExitStatus(value)[source]

Bases: IntEnum

The processor exit status enumerator class

  • Successful: means that the processor reached the end with success

  • Failed: means that the processor did not reach the end with success

  • Aborted: means that the user aborted the processor execution

Aborted = 3

The processor execution was aborted by the user

Failed = 2

The processor execution was failed

Successful = 1

The processor execution was successfully concluded

class mafw.enumerators.ProcessorStatus(value)[source]

Bases: StrEnum

Enumerator to describe the status of a processor.

_generate_next_value_(start, count, last_values)

Return the lower-cased version of the member name.

Finish = 'finishing'

Finished

Init = 'initializing'

Initialized

Run = 'processing'

Running

Start = 'starting'

Started

Unknown = 'unknown'

Unknown status