nvflare.private.json_configer module

class ConfigContext[source]

Bases: object

To init thee ConfigContext.

class JsonConfigurator(config_file_name: str | List[str], base_pkgs: List[str], module_names: List[str], exclude_libs=True, num_passes=1, sys_vars=None)[source]

Bases: JsonObjectProcessor, ComponentBuilder

To init the JsonConfigurator.

  • config_file_name – config filename or list of JSON config file names

  • base_pkgs – base packages need to be scanned

  • module_names – module names need to be scanned

  • exclude_libs – True/False to exclude the libs folder

  • num_passes – number of passes to parsing the config

  • sys_vars – system vars

authorize_and_build_component(config_dict, config_ctx: ConfigContext, node: Node)[source]
finalize_config(config_ctx: ConfigContext)[source]

Provide the package module scanner.

Returns: module_scanner

is_configured_subclass(config_dict, base_class)[source]
process_config_element(config_ctx: ConfigContext, node: Node)[source]
process_element(node: Node)[source]

This method is called by the scan() function for each JSON element scanned.


node – the node representing the JSON element

set_component_build_authorizer(func, **kwargs)[source]
start_config(config_ctx: ConfigContext)[source]