processing_operator

Module that defines the ProcessingOperator class

class tasrif.processing_pipeline.processing_operator.ProcessingOperator(observers=None)

Interface specification of a processing operator The constructor of a concrete operator will provide options to configure the operation. The processing is invoked via the process method and the data to be processed is passed to the process method.

__init__(observers=None)

Base processing operator class

Parameters

observers (list[Observer]) – Python list of observers

set_observers(observers)

Function to store the observers for the given operator.

Parameters

observers (list of Observer) – Observer objects that observe the operator

observe(*data_frames)

Function that runs the observe method for each observer for the given operator

Parameters

*data_frames (list of pd.DataFrame) – Variable number of pandas dataframes to be observed

Raises

RuntimeError – Occurs when super().__init__() is not called in the __init__() method of the ProcessingOperator

process(*data_frames)

Function that runs validation hooks and processes the input data_frames.

Parameters

*data_frames (list of pd.DataFrame) – Variable number of pandas dataframes to be processed

Returns

Output of _process method

is_functional()

Function that returns whether the operator is functional or infrastructure

Returns

whether is_functional

Return type

is_functional (bool)