morpheus.utils.module_utils
Functions
|
|
|
Returns the module configuration for the specified module id. |
|
Loads a module that exists in the module registry. |
|
This function creates a nested module and registers it in the module registry. |
|
Recursively merge two dictionaries, using primary_dict as a tie-breaker. |
|
Registers a module if not exists in the module registry. |
|
This function converts a cudf dataframe to a period approximation. |
|
This function make sure the module configuration contains meta fields. |
|
Module availability in the module registry is verified by this function. |
- get_config_with_overrides(config, module_id, module_name=None, module_namespace='morpheus')[source]
- get_module_config(module_id, builder)[source]
Returns the module configuration for the specified module id.
- Parameters
- module_idstr
- buildermrc.Builder
Unique identifier for a module in the module registry.
MRC Builder object.
- Returns
- configtyping.Dict
Module configuration.
- load_module(config, builder)[source]
Loads a module that exists in the module registry.
- Parameters
- configtyping.Dict
- buildermrc.Builder
Module configuration.
MRC Builder object.
- Returns
- module
Module object.
- make_nested_module(module_id, namespace, ordered_modules_meta)[source]
This function creates a nested module and registers it in the module registry. This module unifies a chain of two or more modules into a single module.
- Parameters
- module_idstr
- namespacestr
- ordered_modules_metatyping.List[typing.Dict[str, str]]
Unique identifier for a module in the module registry.
Namespace to virtually cluster the modules.
The sequence in which the edges between the nodes are made will be determined by ordered modules meta.
- merge_dictionaries(primary_dict, secondary_dict)[source]
Recursively merge two dictionaries, using primary_dict as a tie-breaker.
Lists are treated as a special case, and all unique elements from both dictionaries are included in the final list.
- Args:
- Returns:
primary_dict (dict): The primary dictionary. secondary_dict (dict): The secondary dictionary.
dict: The merged dictionary.
- register_module(module_id, namespace)[source]
Registers a module if not exists in the module registry.
- Parameters
- module_idstr
- namespacestr
Unique identifier for a module in the module registry.
Namespace to virtually cluster the modules.
- Returns
- inner_func
Encapsulated function.
- to_period_cudf_approximation(df, period)[source]
This function converts a cudf dataframe to a period approximation.
- Parameters
- dfcudf.DataFrame
- periodint
Input cudf dataframe.
Period.
- Returns
- cudf.DataFrame
Period approximation of the input cudf dataframe.
- verify_module_meta_fields(config)[source]
This function make sure the module configuration contains meta fields.
- Parameters
- configtyping.Dict
Module configuration.
- verify_module_registration(func)[source]
Module availability in the module registry is verified by this function.
- Parameters
- funcFunction that requires wrapping.
- Returns
- inner_func
Encapsulated function.