API documentation for the constants_loader module

The constants_loader module provides the function load_constants. This is a utility function that retrieves a constants dataclass from the MODULE_REGISTRY and then extracts any configuration details for that constants dataclass from a Config instance.

Functions:

load_constants(config, module_name, class_name)

Load the specified constants class.

virtual_ecosystem.core.constants_loader.load_constants(config: Config, module_name: str, class_name: str) Any

Load the specified constants class.

Any constants that are supplied for this class in the config are used to populate the class, for all other constants default values are used.

Parameters:
  • config – A validated Virtual Ecosystem model configuration object.

  • module_name – Name of the module that the constants belong to

  • class_name – Name of the specific dataclass the constants belong to

Returns:

A constants class populated using the information provided in the config