ctdam.proc.modules.external_functions module¶
- class ctdam.proc.modules.external_functions.ExternalFunctions(modules)[source]¶
Bases:
UserDictA collection of all external functions that are available.
These can be used interchangeably with the other processing modules.
- Parameters:
modules (
list) – A list of modules to import functions from (e.g. gsw)
- functions_of_certain_module(module)[source]¶
Display processing functions of certain module.
- Parameters:
module (
str)- Return type:
dict
- class ctdam.proc.modules.external_functions.ExternalFunctionInfo(external_function)[source]¶
Bases:
objectParsed information of external processing functions.
- Parameters:
external_function (
Callable) – A function
- run(ctd_data, parameters={})[source]¶
Execute the function.
Does either run on explicetly given parameters or tries to determine the input parameters itself.
- Parameters:
ctd_data (
CTDData) – The data to work onparameters (
dict) – The input parameters (Default value = {})
- Return type:
bool
- execute_funtion(args, ctd_data, second_sensor=False)[source]¶
Run function with any source of parameters.
- Parameters:
args (
list) – All arguments for the functionctd_data (
CTDData) – The CTD data to work onsecond_sensor (
bool) – Whether working on second sensor (Default value = False)
- Return type:
bool
- create_cnv_metadata(return_value, second_sensor=False)[source]¶
Build metadata for the new parameter column.
Uses parsed function docstring.
- Parameters:
return_value (
dict) – The expected return value metadata informationsecond_sensor (
bool) – Whether working on second sensor (Default value = False)
- Return type:
dict
- map_parameter(parameter, ctd_data=None)[source]¶
Mapping of function arguments to internally used parameter names.
Obviously a bottleneck for new functions.
- Parameters:
parameter (
str) – The target parameter of interestctd_data (
CTDData|None) – The CTD data to work on (Default value = None)
- Return type:
list
- class ctdam.proc.modules.external_functions.ExternalFunctionCaller(module, processing_functions)[source]¶
Bases:
ArrayModuleModule interface to allow same handling as the other processing modules.
- Parameters:
module (
str) – The module nameprocessing_functions (
ExternalFunctions) – A ExternalFunctions instance