Skip to content

Commit

Permalink
Handle import errors from MACE
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed May 3, 2024
1 parent 1c36d1c commit bc176c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion janus_core/cli/janus.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from janus_core.cli.geomopt import geomopt
from janus_core.cli.md import md
from janus_core.cli.singlepoint import singlepoint
from janus_core.cli.train import train

try:
from janus_core.cli.train import train
except NotImplementedError:
pass

app = Typer(name="janus", no_args_is_help=True)
app.command()(singlepoint)
Expand Down
5 changes: 4 additions & 1 deletion janus_core/helpers/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
from pathlib import Path
from typing import Optional

from mace.cli.run_train import run as run_train
try:
from mace.cli.run_train import run as run_train
except ImportError as e:
raise NotImplementedError("Please update MACE to use this module.") from e
from mace.tools import build_default_arg_parser as mace_parser
import yaml

Expand Down

0 comments on commit bc176c9

Please sign in to comment.