cytoflowgui.workflow.workflow_item

Represents one step in an analysis pipeline. Wraps a single IOperation and any IView of its result.

class cytoflowgui.workflow.workflow_item.WorkflowItem[source]

Bases: traits.has_traits.HasStrictTraits

The basic unit of a Workflow: wraps an operation and a list of views. This class is serialized and synchronized between the LocalWorkflow and the RemoteWorkflow.

Notes

Because we serialize instances of this, we have to pay careful attention to which traits are transient (and aren’t serialized). Additionally, traits marked as status are only serialized remote –> local. For more details about the synchronization, see the module docstring for cytoflowgui.workflow

friendly_id

The operation’s id

name

The operation’s name

operation

The operation that this WorkflowItem wraps

views

The IView’s associated with this operation

current_view

The currently selected view

result

The Experiment that is the result of applying operation to the previous_wi’s result

channels

The channels from result

conditions

The conditions from result

metadata

The metadata from result

statistics

The statistics from result

default_view

The default view for this workflow item (if any)

previous_wi

The previous WorkflowItem in the workflow

next_wi

The next WorkflowItem in the workflow

workflow

The LocalWorkflow or RemoteWorkflow that this WorkflowItem is a part of

status

This WorkflowItem’s status

op_error

Errors from operation’s IOperation.apply method

op_error_trait

The trait that caused the error in op_error

op_warning

Warnings from operation’s IOperation.apply method

op_warning_trait

The trait that caused the warning in op_warning

estimate_error

Errors from operation’s IOperation.estimate method

estimate_warning

Warnings from operation’s IOperation.estimate method

view_error

Errors from the most recently plotted view’s IView.plot method

view_error_trait

The trait that caused the error in view_error

view_warning

Warnings from the most recently plotted view’s IView.plot method

view_warning_trait

The trait that caused the warning in view_warning

plot_names

The possible values for the plot_name parameter of current_view’s IView.plot method. Retrieved from that view’s enum_plots() method and updated automatically when result or current_view changes.

plot_names_label

The GUI label for the element that allows users to select a plot name from plot_names. Updated automatically when result or current_view changes.

matplotlib_events

threading.Event to synchronize matplotlib plotting across process boundaries

plot_lock

threading.Lock to synchronize matplotlib plotting across process boundaries

lock

threading.Lock for updating this WorkflowItem’s traits

edit_traits(view=None, parent=None, kind=None, context=None, handler=None, id='', scrollable=None, **args)[source]

Override the base traits.has_traits.HasTraits.edit_traits to make it go looking for views in the handler.

trait_view(name=None, view_element=None, handler=None)[source]

Gets or sets a ViewElement associated with an object’s class.

If both name and view_element are specified, the view element is associated with name for the current object’s class. (That is, view_element is added to the ViewElements object associated with the current object’s class, indexed by name.)

If only name is specified, the function returns the view element object associated with name, or None if name has no associated view element. View elements retrieved by this function are those that are bound to a class attribute in the class definition, or that are associated with a name by a previous call to this method.

If neither name nor view_element is specified, the method returns a View object, based on the following order of preference:

  1. If there is a View object named traits_view associated with the current object, it is returned.

  2. If there is exactly one View object associated the current object, it is returned.

  3. Otherwise, it returns a View object containing items for all the non-event trait attributes on the current object.

Parameters
  • name (str) – Name of a view element

  • view_element (ViewElement) – View element to associate

Return type

A view element.

estimate()[source]

Call operation’s IOperation.estimate

apply()[source]

Calls operation’s IOperation.apply; applies this WorkflowItem’s operation to previous_wi’s result

plot()[source]

Call current_view’s IView.plot on result, or on previous_wi’s result if there’s no current result.