Source code for poly_lithic.src.transformers.BaseTransformer

from abc import abstractmethod


[docs] class BaseTransformer: @abstractmethod def __init__(self, config: dict): """ config: dict passed from the pv_mappings.yaml files. """ pass
[docs] @abstractmethod def transform(self): """ Call transform function to transform the input data, see SimpleTransformer in model_manager/src/transformers/BaseTransformers.py for an example. """ pass
[docs] @abstractmethod def handler(self, pv_name: str, value: dict | float | int): """ Handler function to handle the input data, in most cases it initiates the transform function when all the input data is available. Handler is the only function exposed to the main loop of the program aside from initial configuration. """ pass