Skip to content

Commit

Permalink
still debuging github
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Jul 10, 2024
1 parent ea7eb84 commit 5037527
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions grid2op/Environment/baseEnv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4092,6 +4092,9 @@ def _aux_gen_classes(cls_other, sys_path, _add_class_output=False):
tmp_nm = f".{tmp_nm}"
sub_repo_mod = env_nm
super_module = importlib.import_module(tmp_nm, package=sub_repo_mod)
add_sys_path = os.path.dirname(super_module.__file__)
if not add_sys_path in sys.path:
sys.path.append(add_sys_path)
try:
module = importlib.import_module(f".{nm_}", package=tmp_nm)
except ModuleNotFoundError as exc_:
Expand Down
3 changes: 2 additions & 1 deletion grid2op/Space/GridObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2888,7 +2888,8 @@ def _aux_init_grid_from_cls(cls, gridobj, name_res):
# issue was the module "_grid2op_classes" had the same name
# regardless of the environment, so grid2op was "confused"
env_path, env_nm = os.path.split(super_module_nm)
sys.path.append(env_path)
if env_path not in sys.path:
sys.path.append(env_path)
super_supermodule = importlib.import_module(env_nm)
module_nm = f"{env_nm}.{module_nm}"
super_module_nm = super_supermodule
Expand Down

0 comments on commit 5037527

Please sign in to comment.