Parsing of experiment configuration¶
Configuration parsing and resolving¶
- orion.core.io.resolve_config.fetch_config(args)[source]¶
Return the config inside the .yaml file if present.
- orion.core.io.resolve_config.fetch_config_from_cmdargs(cmdargs)[source]¶
Turn flat cmdargs into nested dicts like orion.core.config.
- orion.core.io.resolve_config.fetch_env_vars()[source]¶
Fetch environmental variables related to orion’s managerial data.
- orion.core.io.resolve_config.fetch_metadata(user=None, user_args=None, user_script_config=None)[source]¶
Infer rest information about the process + versioning
- orion.core.io.resolve_config.fetch_user_repo(user_script)[source]¶
Fetch the GIT repo and its root path given user’s script.
- orion.core.io.resolve_config.infer_versioning_metadata(user_script)[source]¶
Infer information about user’s script versioning if available. Fills the following information in VCS:
is_dirty shows whether the git repo is at a clean state. HEAD_sha gives the hash of head of the repo. active_branch shows the active branch of the repo. diff_sha shows the hash of the diff in the repo.
- Returns
the VCS but filled with above info.
- orion.core.io.resolve_config.merge_configs(*configs, differentiators=('type',))[source]¶
Merge configuration dictionaries following the given hierarchy
Suppose function is called as merge_configs(A, B, C). Then any pair (key, value) in C would overwrite any previous value from A or B. Same apply for B over A.
If for some pair (key, value), the value is a dictionary, then it will either overwrite previous value if it was not also a directory, or it will be merged following merge_configs(old_value, new_value).
Examples
1a = {'a': 1, 'b': {'c': 2}} 2b = {'b': {'c': 3}} 3c = {'b': {'c': {'d': 4}}} 4 5m = resolve_config.merge_configs(a, b, c) 6 7assert m == {'a': 1, 'b': {'c': {'d': 4}}} 8 9a = {'a': 1, 'b': {'c': 2, 'd': 3}} 10b = {'b': {'c': 4}} 11c = {'b': {'c': {'e': 5}}} 12 13m = resolve_config.merge_configs(a, b, c) 14 15assert m == {'a': 1, 'b': {'c': {'e': 5}, 'd': 3}}