navigate.model.features.feature_related_functions.load_dynamic_parameter_functions
- navigate.model.features.feature_related_functions.load_dynamic_parameter_functions(feature_list: list, feature_parameter_setting_path: str) → None
Load dynamic parameter functions into a feature list.
This function takes a feature list and a path to the parameter setting files and dynamically updates the feature list with parameter values specified in the setting files. It searches for parameter values in the setting files and replaces corresponding arguments in the feature list with the loaded values. The function is designed to support dynamic configuration of feature functions with external parameter files.
Parameters:
- feature_listlist
A list of feature configurations, typically used for specifying configuration options. It may contain dictionaries with “name” and “args” keys, where “name” is the feature function and “args” is a tuple of arguments. Arguments that match parameter names specified in the setting files will be replaced with loaded values.
- feature_parameter_setting_pathstr
The path to the directory containing parameter setting files. These files should be named based on the feature function names (e.g., function_name.yml).
Notes:
The function iterates through the feature list, inspecting each feature dictionary for parameter values specified in the setting files.
Parameters that match argument names in the feature list are replaced with the loaded values from the setting files.
The function supports loading parameter values from YAML files and dynamically updating the feature list.
Example:
Given a feature list and a parameter setting file: - feature_list:
``` [
{“name”: func1, “args”: (arg1, arg2)}, {“name”: func2}, [
{“name”: func3, “args”: (arg3),}, {“name”: func4}
]
parameter setting file (func1.yml):
` arg1: value1 arg2: value2 `
The function would update the feature list as follows: ``` [
{“name”: func1, “args”: (“value1”, “value2”)}, {“name”: func2}, [
{“name”: func3, “args”: (arg3),}, {“name”: func4}
]
]