nvflare.tool.job.config.configer module

build_config_file_indices(job_folder: str, app_names: List[str]) Dict[str, Dict[str, Tuple]][source]
convert_to_number(value: str)[source]
extract_string_with_index(input_string)[source]

Extract the string before ‘[’, the index within ‘[’, and the string after ‘]’.

Parameters:

input_string (str) – The input string containing the pattern ‘[index]’.

Returns:

A list of tuples containing the extracted components: (string_before, index, string_after).

Return type:

list

filter_config_name_and_values(excluded_key_list: List[str], key_indices: Dict[str, List[KeyIndex]]) Dict[str, KeyIndex][source]
filter_indices(app_indices_configs: Dict[str, Dict[str, Tuple]]) Dict[str, Dict[str, Dict[str, KeyIndex]]][source]
get_app_name_from_path(path: str)[source]
get_cli_config(cmd_args: Any, app_names: List[str]) Dict[str, Dict[str, Dict[str, str]]][source]

Extracts configurations from command-line arguments and return them in a dictionary.

Parameters:
  • app_names – application names

  • cmd_args – Command-line arguments containing configuration data.

Returns:

A dictionary containing the configurations extracted from the command-line arguments.

get_config_file_path(app_name, input_file_path, job_folder)[source]
get_last_token(input_string)[source]
get_root_index(key_index: KeyIndex) KeyIndex | None[source]
handle_key_in_path_notation_or_new_key(file: str, key: str, cli_value: str, config: ConfigTree, key_indices: Dict)[source]
merge_configs(app_indices_configs: Dict[str, Dict[str, tuple]], app_cli_file_configs: Dict[str, Dict[str, Dict]]) Dict[str, Dict[str, tuple]][source]

Merges configurations from indices_configs and cli_file_configs.

Parameters:
  • app_indices_configs (Dict[str, Dict[str, tuple]]) – A dictionary containing indices and configurations.

  • app_cli_file_configs (Dict[str, Dict[str, Dict]]) – A dictionary containing CLI configurations.

Returns:

A dictionary of {app_name: merged configurations}.

Each of the merged configurations can be expressed in a Tuple: config, excluded_key_List, key_indices

Return type:

Dict[str, Dict[str, Tuple]]

merge_configs_from_cli(cmd_args, app_names: List[str]) Tuple[Dict[str, Dict[str, tuple]], bool][source]
split_array_key(key: str) Tuple[source]