Stage
A stage is fundamental to an experiment. A stage typically describes an epoch during an experiment when something happens or when we wait for something to happen. An experiment is composed of many stages.
A stage can contain other stages.
- class pymoa.stage.MoaStage(repeat=1, max_duration=0.0, max_trial_duration=0.0, order='serial', complete_on='all', complete_on_whom=(), disabled=False, **kwargs)
 Bases:
EventDispatcher,MoaBaseBase stage for structuring an experiment.
- add_stage(stage: MoaStage, index: int | None = None, **kwargs)
 Different than widget because of None.
- complete_on: str = 'all'
 If parallel, whether it completes when any or all of its sub-stages are done. Can be all, any, or a list-type of child and self.
- complete_on_whom: List[MoaStage] = []
 If parallel, whether it completes when any or all of its sub-stages are done. Can be all, any, or a list-type of child and self.
- count: int = -1
 Zero is the first etc. updated after the loop jumps back. read only
- disabled: bool = False
 If this stage is disabled.
- await init_stage()
 Should take minimal time and must be called with
super.
- await init_trial(i: int)
 Should take minimal time and must be called with
super.
- max_duration: float = 0
 If non zero, the total duration that this stage goes on. Including the loops and stage initialization, excluding
stage_done().
- max_trial_duration: float = 0
 If non zero, the total duration that each trial goes on. Including the trial initialization but excluding
trial_done().
- order: str = 'serial'
 Whether sub-stages are run at same time or one after the other.
- parent: MoaStage = None
 Parent of this widget.
parentis anObjectPropertyand defaults to None.The parent of a widget is set when the widget is added to another widget and unset when the widget is removed from its parent.
- repeat: int = 1
 1 is once, -1 is indefinitely.
- await stage_done(exception=False, canceled=False)
 Canceled means that cancel was called for this specific stage and it ended early.
Called under a shielded cancel scope.
- stages: List[MoaStage] = []
 A list of children
MoaStageinstance. When a stage is started, it’s children stages are also started with the exact details depending on theorder.Similarly, a stage is considred finished when its children stages are done and when its loops are done, depending on
It is read only. To modify, call
add_stage()orremove_stage().
- stop_trial()
 Continues the next trial.
- await trial_done(exception=False, canceled=False)
 Canceled means that cancel was called for this specific stage and trial, or it timed out, or the complete_on_whom caused it to exit.
Called under a shielded cancel scope.