Skip to content

Commit

Permalink
Fix: local/nonlocal config folder for mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Feb 1, 2024
1 parent cc2e462 commit 6e04989
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions emodel_generalisation/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,9 @@ def assign(input_node_path, population_name, output_node_path, config_path, loca
emodel_mappings = defaultdict(lambda: defaultdict(dict))
L.info("Creating emodel mappings...")
etype_emodel_map = None
if (Path(config_path) / "etype_emodel_map.csv").exists():
etype_emodel_map = pd.read_csv(Path(config_path) / "etype_emodel_map.csv")
_config_path = config_path if config_path.is_dir() else local_config_path
if (Path(_config_path) / "etype_emodel_map.csv").exists():
etype_emodel_map = pd.read_csv(Path(_config_path) / "etype_emodel_map.csv")

if etype_emodel_map is not None:
for (region, etype, mtype), d in etype_emodel_map.groupby(["region", "etype", "mtype"]):
Expand Down

0 comments on commit 6e04989

Please sign in to comment.