Skip to content

Commit

Permalink
Fix duplicate model_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar authored and alinelena committed Mar 5, 2024
1 parent 5d6235f commit f77883f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions janus_core/mlip_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def choose_calculator(
from mace.calculators import mace_mp

kwargs.setdefault("default_dtype", "float64")
kwargs.setdefault("model", "small")
kwargs["model"] = kwargs.pop("model_paths", "small")
calculator = mace_mp(**kwargs)

elif architecture == "mace_off":
from mace import __version__
from mace.calculators import mace_off

kwargs.setdefault("default_dtype", "float64")
kwargs.setdefault("model", "small")
kwargs["model"] = kwargs.pop("model_paths", "small")
calculator = mace_off(**kwargs)

elif architecture == "m3gnet":
Expand Down
10 changes: 10 additions & 0 deletions tests/test_mlip_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
),
("mace_off", "cpu", {}),
("mace_mp", "cpu", {}),
(
"mace_mp",
"cpu",
{"model_paths": Path(__file__).parent / "models" / "mace_mp_small.model"},
),
(
"mace_off",
"cpu",
{"model_paths": "small"},
),
]

test_data_extras = [("m3gnet", "cpu"), ("chgnet", "")]
Expand Down

0 comments on commit f77883f

Please sign in to comment.