nvflare.fuel.utils.wfconf module

class ConfigContext[source]

Bases: object

Object containing configuration context.

class Configurator(app_root: str, cmd_vars: dict, env_config: dict, wf_config_file_name: str, base_pkgs: List[str], module_names: List[str], exclude_libs=True, default_vars=None, num_passes=1, element_filter=None, var_processor=None)[source]

Bases: JsonObjectProcessor

Base class of Configurator to parse JSON configuration.

  • app_root – app root

  • cmd_vars – command vars

  • env_config – environment configuration

  • wf_config_file_name – config file name

  • base_pkgs – base packages

  • module_names – module names

  • exclude_libs – whether to exclude libs

  • default_vars – default vars

  • num_passes – number of passes

  • element_filter – element filter

  • var_processor – variable processor

finalize_config(config_ctx: ConfigContext)[source]
is_configured_subclass(config_dict, base_class)[source]
process_args(args: dict)[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

start_config(config_ctx: ConfigContext)[source]

Get component reference.


component – string for component

Returns: list of component and reference

resolve_var_refs(scanner: JsonScanner, var_values: dict)[source]

Resolve var references in the config contained in the scanner

  • scanner – the scanner that contains config data to be resolved

  • var_values – the dict that contains var values.

Returns: None