(Latest Version)

morpheus.utils.module_utils

Functions

<a href="#morpheus.utils.module_utils.get_config_with_overrides">get_config_with_overrides</a>(config, module_id)

<a href="#morpheus.utils.module_utils.get_module_config">get_module_config</a>(module_id, builder)

Returns the module configuration for the specified module id.

<a href="#morpheus.utils.module_utils.load_module">load_module</a>(config, builder)

Loads a module that exists in the module registry.

<a href="#morpheus.utils.module_utils.make_nested_module">make_nested_module</a>(module_id, namespace, ...)

This function creates a nested module and registers it in the module registry.

<a href="#morpheus.utils.module_utils.merge_dictionaries">merge_dictionaries</a>(primary_dict, secondary_dict)

Recursively merge two dictionaries, using primary_dict as a tie-breaker.

<a href="#morpheus.utils.module_utils.register_module">register_module</a>(module_id, namespace)

Registers a module if not exists in the module registry.

<a href="#morpheus.utils.module_utils.to_period_cudf_approximation">to_period_cudf_approximation</a>(df, period)

This function converts a cudf dataframe to a period approximation.

<a href="#morpheus.utils.module_utils.verify_module_meta_fields">verify_module_meta_fields</a>(config)

This function make sure the module configuration contains meta fields.

<a href="#morpheus.utils.module_utils.verify_module_registration">verify_module_registration</a>(func)

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

Unique identifier for a module in the module registry.

buildermrc.Builder

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

Module configuration.

buildermrc.Builder

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

Unique identifier for a module in the module registry.

namespacestr

Namespace to virtually cluster the modules.

ordered_modules_metatyping.List[typing.Dict[str, str]]

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:

primary_dict (dict): The primary dictionary. secondary_dict (dict): The secondary dictionary.

Returns:

dict: The merged dictionary.

register_module(module_id, namespace)[source]

Registers a module if not exists in the module registry.

Parameters
module_idstr

Unique identifier for a module in the module registry.

namespacestr

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

Input cudf dataframe.

periodint

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.

© Copyright 2023, NVIDIA. Last updated on Apr 11, 2023.