Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install problems #119

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
Empty file.
9 changes: 5 additions & 4 deletions vivarium/utils/scene_configs.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import os
import logging

import hydra

from omegaconf import OmegaConf
from omegaconf import OmegaConf, DictConfig
from hydra import initialize, compose
from hydra.core.global_hydra import GlobalHydra

CONF_DIR_PATH = "../../conf"
abs_config_dir_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../conf"))
config_dir_path = os.path.relpath(abs_config_dir_path, start=os.path.dirname(__file__))


def load_default_config() -> DictConfig:
"""Load the default scene configuration

:return: default scene configuration
"""
with initialize(config_path=CONF_DIR_PATH, version_base=None):
with initialize(config_path=config_dir_path, version_base=None):
cfg = compose(config_name="config")
scene_config = OmegaConf.merge(cfg.default, cfg.scene)
return scene_config
Expand All @@ -30,7 +31,7 @@ def load_scene_config(scene_name: str) -> DictConfig:
if GlobalHydra().is_initialized():
GlobalHydra().clear()

with hydra.initialize(config_path=CONF_DIR_PATH, version_base=None):
with hydra.initialize(config_path=config_dir_path, version_base=None):
cfg = hydra.compose(config_name="config", overrides=[f"scene={scene_name}"])
logging.basicConfig(level=cfg.log_level)
scene_config = OmegaConf.merge(cfg.default, cfg.scene)
Expand Down