51Degrees Pipeline for Python

fiftyone_pipeline_core.flowelement.FlowElement Class Reference

Detailed Description

A FlowElement is placed inside a Pipeline It receives Evidence via a FlowData object It uses this to optionally create ElementData on the FlowData Any errors in processing are caught in the FlowData's errors object.

Inheritance diagram for fiftyone_pipeline_core.flowelement.FlowElement:

[legend]

Collaboration diagram for fiftyone_pipeline_core.flowelement.FlowElement:

[legend]

Public Member Functions

 __init__ (self)
 List of Pipelines the FlowElement has been added to.
 process (self, flowdata)
 Function for getting the FlowElement's EvidenceKeyFilter Used by the filterEvidence method.
 on_registration (self, pipeline)
 Function called when an element is added to the pipeline.
 close (self)
 Release the resources the element holds.
 get_evidence_key_filter (self)
 Filter FlowData evidence using the FlowElement's EvidenceKeyFilter.
 filter_evidence (self, flowdata)
 Filter FlowData evidence using the FlowElement's EvidenceKeyFilter.
 filter_evidence_key (self, key)
 Filter FlowData.evidence using the flowElement's EvidenceKeyFilter with the property key of evidence of interest.
 process_internal (self, flowdata)
 The method behind FlowElement.Process - it is called by the process() function.
 get_properties (self)
 Get the FlowElement.properties of a FlowElement.

Public Attributes

list pipelines = []
dict properties = {}
str datakey = ""
bool exclude_from_messages = False

Protected Member Functions

 _log (self, level, message)

Constructor & Destructor Documentation

◆ __init__()

fiftyone_pipeline_core.flowelement.FlowElement.__init__ ( self)

List of Pipelines the FlowElement has been added to.

Member Function Documentation

◆ _log()

fiftyone_pipeline_core.flowelement.FlowElement._log ( self,
level,
message )
protected

◆ close()

fiftyone_pipeline_core.flowelement.FlowElement.close ( self)

Release the resources the element holds.

The pipeline calls this when it is closed. This element holds none, and elements that hold native data or threads override it.

Reimplemented in fiftyone_pipeline_engines.engine.Engine, fiftyone_pipeline_engines_fiftyone.share_usage.ShareUsage, tests.test_close.ClosingElement, tests.test_close.FailingElement, and tests.test_close.RecordedElement.

◆ filter_evidence()

fiftyone_pipeline_core.flowelement.FlowElement.filter_evidence ( self,
flowdata )

Filter FlowData evidence using the FlowElement's EvidenceKeyFilter.

@type flowdata: FlowData

Parameters
flowdataa FlowData that has some Evidence set

@rtype: dict

Returns
: Returns a dictionary of evidence that has passed the filter

◆ filter_evidence_key()

fiftyone_pipeline_core.flowelement.FlowElement.filter_evidence_key ( self,
key )

Filter FlowData.evidence using the flowElement's EvidenceKeyFilter with the property key of evidence of interest.

@type key: string

Parameters
keythe property key being sought within FlowData.evidence

@rtype: dict

Returns
: Returns a dictionary containing the property key and the evidence related to it as its value

◆ get_evidence_key_filter()

◆ get_properties()

fiftyone_pipeline_core.flowelement.FlowElement.get_properties ( self)

Get the FlowElement.properties of a FlowElement.

This is usually overridden by specific flowElements.

@rtype: DataPropertyDictionary

Returns
: Returns dictionary of the FlowElement's properties

◆ on_registration()

fiftyone_pipeline_core.flowelement.FlowElement.on_registration ( self,
pipeline )

Function called when an element is added to the pipeline.

Used for example, for elements that depend on other elements in a pipeline

@type pipeline: Pipeline

Parameters
pipelinePipeline the element has been added to

Reimplemented in fiftyone_pipeline_cloudrequestengine.cloudengine.CloudEngine, and fiftyone_pipeline_engines.engine.Engine.

◆ process()

fiftyone_pipeline_core.flowelement.FlowElement.process ( self,
flowdata )

Function for getting the FlowElement's EvidenceKeyFilter Used by the filterEvidence method.

@type flowdata: FlowData

Parameters
flowdataFlowData to be processed

@rtype: mixed

Returns
: Returns whatever the self.processInternal method is set to return

Reimplemented in fiftyone_pipeline_engines.engine.Engine.

◆ process_internal()

fiftyone_pipeline_core.flowelement.FlowElement.process_internal ( self,
flowdata )

Member Data Documentation

◆ datakey

str fiftyone_pipeline_core.flowelement.FlowElement.datakey = ""

◆ exclude_from_messages

bool fiftyone_pipeline_core.flowelement.FlowElement.exclude_from_messages = False

◆ pipelines

list fiftyone_pipeline_core.flowelement.FlowElement.pipelines = []

◆ properties

dict fiftyone_pipeline_core.flowelement.FlowElement.properties = {}