banffprocessor.procedures package#

Subpackages#

Submodules#

banffprocessor.procedures.factory module#

Register and unregister ProcedureInterface instances with the Banff Processor.

banffprocessor.procedures.factory.get_procedure(procedure_name: str) type[ProcedureInterface][source]#

Get a Procedure class under a specified name.

Parameters:

procedure_name (str) – The name of the procedure to fetch

Raises:

ValueError – If procedure_name is not found

Returns:

The class reference registered under procedure_name

Return type:

type[ProcedureInterface]

banffprocessor.procedures.factory.register(procedure_name: str | list[str], cls: type[ProcedureInterface]) None[source]#

Register plugin class cls under procedure_name.

Parameters:
  • procedure_name (str) – The name to register the procedure under

  • cls (type[ProcedureInterface]) – The class reference to register

banffprocessor.procedures.factory.unregister(to_remove: str) None[source]#

Unregister the plugin class found under procedure_name.

Parameters:

procedure_name (str) – The name of the procedure to unregister

banffprocessor.procedures.loader module#

Load plugin files from a defined location as python modules.

banffprocessor.procedures.loader.load_plugins(plugin_dir: str | Path) None[source]#

Load plugins from the plugin directory.

Load all python files that include a register function from plugin_dir as modules and call these register functions to load plugin classes.

Parameters:

plugin_dir (str | Path) – The directory where the plugin files to load are located

Raises:

ValueError – If plugin_dir is an empty string or None

banffprocessor.procedures.procedure_interface module#

class banffprocessor.procedures.procedure_interface.ProcedureInterface(*args, **kwargs)[source]#

Bases: Protocol

An Interface class for custom User Defined Procedures to implement in order to be used in a Banff Job.

classmethod execute(processor_data: ProcessorData) int[source]#

Perform the work in a procedure call (i.e. forms a banff call and executes it) and return the return code (0 for success and no errors, any non-0 value means one or more errors occured).

Module contents#