cytoflowgui.workflow.operations.operation_base¶
- class cytoflowgui.workflow.operations.operation_base.IWorkflowOperation(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]¶
Bases:
cytoflow.operations.i_operation.IOperation
An interface that extends a
cytoflow
operation with functions required for GUI support.In addition to implementing the interface below, another common thing to do in the derived class is to override traits of the underlying class in order to add metadata that controls their handling by the workflow. Currently, relevant metadata include:
apply - This trait is used by the operations
apply
method.estimate - This trait is used by the operation’s
estimate
method.estimate_result - This trait is set as a result of calling
estimate
.status - Holds status variables like the number of events from the
ImportOp
.transient - A temporary variable (not copied between processes or serialized).
- changed¶
Used to transmit status information back from the operation to the workflow. Set its value to the name of the trait that was changed
- Type
Event
- should_apply(changed, payload)[source]¶
Should the owning WorkflowItem apply this operation when certain things change?
changed
can be:Changed.APPLY – the parameters required to run apply() changed
Changed.PREV_RESULT – the previous WorkflowItem’s result changed
Changed.ESTIMATE_RESULT – the results of calling “estimate” changed
If
should_apply
is called from a notification handler, thenpayload
is theevent
object from the notification handler.
- should_clear_estimate(changed, payload)[source]¶
Should the owning WorkflowItem clear the estimated model by calling op.clear_estimate()?
changed
can be:Changed.ESTIMATE – the parameters required to call
estimate
(ie traits withestimate = True
metadata) have changedChanged.PREV_RESULT – the previous
WorkflowItem
’s result changed
If
should_clear_estimate
is called from a notificaion handler, thenpayload
is theevent
object.
- get_notebook_code(idx)[source]¶
Return Python code suitable for a Jupyter notebook cell that runs this operation.
- Parameters
idx (integer) – The index of the
WorkflowItem
that holds this operation.- Returns
The Python code that calls this module.
- Return type
string
- class cytoflowgui.workflow.operations.operation_base.WorkflowOperation[source]¶
Bases:
traits.has_traits.HasStrictTraits
A default implementation of
IWorkflowOperation