Skip to content

Commit f1b1463

Browse files
committed
f
1 parent 6f9d836 commit f1b1463

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

janus_core/helpers/mlip_calculators.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,10 @@ def choose_calculator(
229229
from orb_models.forcefield.calculator import ORBCalculator
230230
from orb_models.forcefield.graph_regressor import GraphRegressor
231231
import orb_models.forcefield.pretrained as orb_ff
232+
from orb_models.forcefield.pretrained import orb_v2_mptraj_only as orb_mptraj_only_v2
232233

233-
if isinstance(model_path, str):
234-
match model_path:
235-
case "orb-v2":
236-
model = orb_ff.orb_v2()
237-
case "orb-mptraj-only-v2":
238-
model = orb_ff.orb_v2_mptraj_only()
239-
case "orb-d3-v2":
240-
model = orb_ff.orb_d3_v2()
241-
case "orb-d3-xs-v2":
242-
model = orb_ff.orb_d3_xs_v2()
243-
case "orb-d3-sm-v2":
244-
model = orb_ff.orb_d3_sm_v2()
245-
case _:
234+
model = getattr(orb_ff, model_path.sub("-", "_"), None)()
235+
if model is None:
246236
raise ValueError(
247237
"Please specify `model_path`, as there is no "
248238
f"default model for {arch}"

0 commit comments

Comments
 (0)