layer_management#
OM’s layer management.
This module contains classes and functions that mange OM’s various data processing and extraction layers.
- import_class_from_layer(*, layer_name: Literal['processing_layer'], class_name: str) type[OmProcessingProtocol]#
- import_class_from_layer(*, layer_name: Literal['data_retrieval_layer'], class_name: str) type[OmDataEventHandlerProtocol]
- import_class_from_layer(*, layer_name: Literal['parallelization_layer'], class_name: str) type[OmParallelizationProtocol]
Imports a class from an OM’s layer.
This function imports a class, identified by the class_name argument, from a layer identified by the layer_name argument. The function looks for a python module containing the layer code in the current working directory first. Specifically, it looks for a python file with the same name as the layer. If the function cannot find the file, it imports the layer from OM’s normal installation directories. It then proceeds to import the requested class from the layer module.
- Parameters:
layer_name – The name of the layer from which the class should be imported.
class_name – The name of the class to import.
- Returns:
The imported class.
- Raises:
OmMissingLayerClass – Raised if the requested class cannot be found in the specified Python module.
OmMissingLayerModuleFile – Raised if the requested python module cannot be found.
- import_data_source_class(*, module_names, class_name)#
Imports a class from an OM’s layer.
This function imports a class, identified by the class_name argument, from a layer identified by the layer_name argument. The function looks for a python module containing the layer code in the current working directory first. Specifically, it looks for a python file with the same name as the layer. If the function cannot find the file, it imports the layer from OM’s normal installation directories. It then proceeds to import the requested class from the layer module.
- Parameters:
layer_name – The name of the layer from which the class should be imported.
class_name (str) – The name of the class to import.
module_names (list[str])
- Returns:
The imported class.
- Raises:
OmMissingLayerClass – Raised if the requested class cannot be found in the specified Python module.
OmMissingLayerModuleFile – Raised if the requested python module cannot be found.
- Return type:
type[OmDataSourceProtocol]