ska_sdp_batchlet.plugins.utils module
- ska_sdp_batchlet.plugins.utils.load_plugin(plugin_base_class, name, path=None, **_)[source]
Validates and returns a plugin class.
- Parameters:
- Return type:
- Returns:
The validated plugin class.
- Raises:
ImportError -- If the specified class is not found in the module.
TypeError -- If the class is not a subclass of plugin_base_class.
- ska_sdp_batchlet.plugins.utils.instantiate_plugins(plugin_base_class, plugin_configs)[source]
Instantiate plugins based on the configuration.
- Parameters:
plugin_base_class (
type[TypeVar(BasePlugin)]) -- The base class type that the plugins must inherit from.plugin_configs (
list[dict]) --List of plugin configurations. Each configuration is a dictionary with following keys:
name: Name of the plugin class to load
- path: (optional) Path to the python module which contains the
plugin class
- kwargs: (optional) Extra key-word argumments passed to the
plugin class while instantiating.
- Return type:
- Returns:
List of fully initialized plugin objects
- Raises:
ImportError -- If the specified class is not found in the module.
TypeError -- If the class is not a subclass of plugin_base_class.