Skip to content

Commit

Permalink
Changed experiments test logic
Browse files Browse the repository at this point in the history
  • Loading branch information
BarzaH committed Aug 13, 2024
1 parent 0fd04aa commit 0048fe0
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions tests/integration/schema/test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,17 @@ def test_experiments(experiment_config_file):
from hydra import compose, initialize
from hydra.core.global_hydra import GlobalHydra

GlobalHydra.instance().clear()
initialize(config_path="../../../config", job_name="test_app")

experiment_file = f"{str(os.path.splitext(experiment_config_file)[0]).split('/experiments/')[-1]}"

cfg = compose(
config_name="train",
overrides=[f"experiments={experiment_file}"], # experiment_config_file.stem
return_hydra_config=True,
)
get_experiment(cfg)
# cfg = OmegaConf.to_yaml(cfg)
# logging.info(cfg)
if "example" in experiment_config_file:
GlobalHydra.instance().clear()
initialize(config_path="../../../config", job_name="test_app")

experiment_file = f"{str(os.path.splitext(experiment_config_file)[0]).split('/experiments/')[-1]}"

cfg = compose(
config_name="train",
overrides=[f"experiments={experiment_file}"], # experiment_config_file.stem
return_hydra_config=True,
)
get_experiment(cfg)
# cfg = OmegaConf.to_yaml(cfg)
# logging.info(cfg)

0 comments on commit 0048fe0

Please sign in to comment.