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).

do_estimate

Firing this event causes the operation’s estimate method to be called.

Type

Event

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, then payload is the event 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 with estimate = True metadata) have changed

  • Changed.PREV_RESULT – the previous WorkflowItem’s result changed

If should_clear_estimate is called from a notificaion handler, then payload is the event object.

clear_estimate()[source]

Clear whatever variables hold the results of calling estimate()

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

should_apply(changed, payload)[source]
should_clear_estimate(changed, payload)[source]
clear_estimate()[source]
get_notebook_code(idx)[source]