Skip to content

Commit 59a5757

Browse files
authored
Merge pull request #74 from Point72/pit/hydra_load_config
Add version_base flag to load_config
2 parents 39a640f + 9f2ca71 commit 59a5757

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ccflow/utils/hydra.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def load_config(
135135
config_name: str = "",
136136
overrides: Optional[List[str]] = None,
137137
*,
138+
version_base: Optional[str] = None,
138139
basepath: str = "",
139140
debug: bool = False,
140141
) -> ConfigLoadResult:
@@ -153,6 +154,7 @@ def load_config(
153154
config_dir: End user-provided additional directory to search for hydra configs.
154155
config_name: An optional config name to look for within the `config_dir`. This allows you to specify a particular config file to load.
155156
overrides: A list of hydra-style override strings to apply when loading the config.
157+
version_base: See https://hydra.cc/docs/upgrades/version_base/
156158
basepath: The base path to start searching for the `config_dir`. This is useful when you want to load from an absolute (rather than relative) path.
157159
debug: (Experimental) Whether to enable debug mode. This will return more information about the configs on ConfigLoadResult.
158160
"""
@@ -162,7 +164,7 @@ def load_config(
162164
from hydra import compose, initialize_config_dir
163165

164166
overrides = overrides or []
165-
with initialize_config_dir(config_dir=root_config_dir, version_base=None):
167+
with initialize_config_dir(config_dir=root_config_dir, version_base=version_base):
166168
if config_dir:
167169
hydra_folder, config_dir, _ = _find_parent_config_folder(config_dir=config_dir, config_name=config_name, basepath=basepath or os.getcwd())
168170

0 commit comments

Comments
 (0)