51Degrees Pipeline Python  4.1

51Degrees Pipeline for Python
  • pipeline-python
  • fiftyone_pipeline_core
  • fiftyone_pipeline_core
  • flowdata
  • FlowData

pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData Class Reference

Detailed Description

FlowData is created by a specific Pipeline It collects evidence set by the user It passes evidence to FlowElements in the Pipeline These elements can return ElementData or populate an errors object.

Public Member Functions

def  __init__ (self, pipeline)
FlowData constructor. More...
def  process (self)
Runs the process function on every attached flowElement allowing data to be changed based on evidence. More...
def  get_from_element (self, flow_element)
Retrieve data by FlowElement object. More...
def  get (self, flow_element_key)
Retrieve data by flowElement key. More...
def  __getattr__ (self, flow_element_key)
Magic getter to allow retrieval of data from FlowData.data[flowElementKey] by flowElement name. More...
def  set_element_data (self, element_data)
Set data (used by flowElement) within FlowData.data. More...
def  set_error (self, key, error)
Set error (should be keyed by flowElement datakey) More...
def  get_evidence_datakey (self)
Get a list of evidence stored in the flowData, filtered by its flowElements' evidenceKeyFilters. More...
def  stop (self)
Stop processing any subsequent flowElements. More...
def  get_where (self, metakey, metavalue)
Get data from flowElement based on property meta data. More...

Public Attributes

 data
 errors
 pipeline
 processed
 stopped
 evidence

Constructor & Destructor Documentation

◆ __init__()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.__init__ (   self,
  pipeline  
)

FlowData constructor.

@type pipeline: Pipeline

Parameters
pipeline - parent pipeline

Member Function Documentation

◆ __getattr__()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.__getattr__ (   self,
  flow_element_key  
)

Magic getter to allow retrieval of data from FlowData.data[flowElementKey] by flowElement name.

For example, instead of flowdata.get("device") you can use flowData.device

@type flow_element_key: string

Parameters
flow_element_key - datakey of the FlowElement that created the data of interest

@rtype: ElementData

◆ get()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.get (   self,
  flow_element_key  
)

Retrieve data by flowElement key.

Called by FlowData.get_from_element method.

@type flow_element_key: string

Parameters
flow_element_key - FlowElement.datakey of the FlowElement that created the data of interest

@rtype: ElementData

Returns
: Returns data in the FlowData instance that is under the specified key

◆ get_evidence_datakey()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.get_evidence_datakey (   self )

Get a list of evidence stored in the flowData, filtered by its flowElements' evidenceKeyFilters.

@rtype: list

Returns
: Returns filtered evidence

◆ get_from_element()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.get_from_element (   self,
  flow_element  
)

Retrieve data by FlowElement object.

@type flow_element: FlowElement

Parameters
flow_element - FlowElement that created the data of interest

@rtype: ElementData

Returns
: Returns data that was created by the flowElement held in the FlowData

◆ get_where()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.get_where (   self,
  metakey,
  metavalue  
)

Get data from flowElement based on property meta data.

@type metakey: str

Parameters
metakey - metakey shared by all data of interest

@type metavalue: mixed

Parameters
metavalue - meta value shared by all data of interest

@rtype: dict

Returns
: Returns dictionary of data created by the flowElement that have the specified meta property

◆ process()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.process (   self )

Runs the process function on every attached flowElement allowing data to be changed based on evidence.

This can only be run once per FlowData instance.

@rtype: FlowData

Returns
: Returns flowData

◆ set_element_data()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.set_element_data (   self,
  element_data  
)

Set data (used by flowElement) within FlowData.data.

@type element_data: ElementData

Parameters
element_data - elementData to be added to flowData

◆ set_error()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.set_error (   self,
  key,
  error  
)

Set error (should be keyed by flowElement datakey)

@type key: string

Parameters
key - a flowElement.datakey

@type error: string

Parameters
error - Error message

◆ stop()

def pipeline-python.fiftyone_pipeline_core.fiftyone_pipeline_core.flowdata.FlowData.stop (   self )

Stop processing any subsequent flowElements.

Returns
void