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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
a = {'a': 1, 'b': {'c': 2}} b = {'b': {'c': 3}} c = {'b': {'c': {'d': 4}}} m = resolve_config.merge_configs(a, b, c) assert m == {'a': 1, 'b': {'c': {'d': 4}}} a = {'a': 1, 'b': {'c': 2, 'd': 3}} b = {'b': {'c': 4}} c = {'b': {'c': {'e': 5}}} m = resolve_config.merge_configs(a, b, c) assert m == {'a': 1, 'b': {'c': {'e': 5}, 'd': 3}}