Traits

State traits are verified for all Runnable objects that inherit from StateTraits or its subclasses. Verification includes:

  1. Minimal checks of workflow construction (composition of Runnable classes)
  2. Runtime checks

All built-in Runnable classes declare state traits requirements that are either independent (for simple ones) or derived from a child workflow. Traits of a new Runnable must be expressed and modified at construction time by its parent. When developing new Runnable classes, constructing composite traits can be nontrivial for some advanced flow-control runnables.

State traits validation base class and related state validation mixins (i/o validation toggle, i/o dimensionality, state structure).

When subclassing (combining with Runnable), list them in the following order, left to right:

  • structure mixins (e.g. SubsamplesIntaking and SubproblemSampler)
  • dimensionality mixins (e.g. MultiInputStates and MISO)
  • validation toggles (e.g. InputValidated and NotValidated)
  • StateTraits base class (not required if any of the above is used)
  • Runnable base class

For example:

class MyRunnable(hybrid.traits.SubsamplesIntaking, hybrid.traits.MISO, hybid.Runnable):
pass
class StateTraits[source]

Set of traits imposed on State. By default, not validated.

validate_state_trait(state, trait, io)[source]

Validate single input/output (io) state trait.

class InputValidated[source]
class OutputValidated[source]
class InputNotValidated[source]
class OutputNotValidated[source]
class Validated[source]

Validated input state(s) and output state(s).

class NotValidated[source]

Input state(s) and output state(s) are not validated.

class SingleInputState[source]
class MultiInputStates[source]
class SingleOutputState[source]
class MultiOutputStates[source]
class SISO[source]

Single Input, Single Output.

class SIMO[source]

Single Input, Multiple Outputs.

class MIMO[source]

Multiple Inputs, Multiple Outputs.

class MISO[source]

Multiple Inputs, Single Output.

class ProblemIntaking[source]
class ProblemProducing[source]
class SamplesIntaking[source]
class SamplesProducing[source]
class SubproblemIntaking[source]
class SubproblemProducing[source]
class SubsamplesIntaking[source]
class SubsamplesProducing[source]
class EmbeddingIntaking[source]
class EmbeddingProducing[source]
class ProblemDecomposer[source]
class SubsamplesComposer[source]
class ProblemSampler[source]
class SubproblemSampler[source]
class SamplesProcessor[source]
class SubsamplesProcessor[source]