File tree 2 files changed +20
-7
lines changed
2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ ase = ["ase>=3.23.0"]
65
65
# tblite py3.12 support tracked in https://github.com/tblite/tblite/issues/198
66
66
ase-ext = [" tblite>=0.3.0; python_version < '3.12'" ]
67
67
openmm = [
68
- " mdanalysis>=2.7 .0" ,
68
+ " mdanalysis>=2.8 .0" ,
69
69
" openmm-mdanalysis-reporter>=0.1.0" ,
70
70
" openmm>=8.1.0" ,
71
71
]
Original file line number Diff line number Diff line change @@ -36,17 +36,30 @@ class written by Harry Moore. The nnpops_nl function
36
36
import numpy as np
37
37
import openmm
38
38
import openmm .app
39
- import openmmtorch
40
39
import torch
41
40
from e3nn .util import jit
42
41
from mace .tools import atomic_numbers_to_indices , to_one_hot , utils
43
42
44
43
try :
45
44
from NNPOps .neighbors import getNeighborPairs
46
- except ImportError as err :
47
- raise ImportError (
48
- "NNPOps is not installed. Please install it from conda-forge."
49
- ) from err
45
+ except ImportError :
46
+
47
+ def getNeighborPairs (* args , ** kwargs ) -> None : # noqa: N802, ARG001
48
+ """Raise ImportError if NNPOps is not installed."""
49
+ raise ImportError (
50
+ "NNPOps is not installed. Please install it from conda-forge."
51
+ )
52
+
53
+
54
+ try :
55
+ from openmmtorch import TorchForce
56
+ except ImportError :
57
+
58
+ def TorchForce (* args , ** kwargs ) -> None : # noqa: N802, ARG001
59
+ """Raise ImportError if openmmtorch is not installed."""
60
+ raise ImportError (
61
+ "openmmtorch is not installed. Please install it from conda-forge."
62
+ )
50
63
51
64
52
65
class MaceForce (torch .nn .Module ):
@@ -314,7 +327,7 @@ def add_forces(
314
327
module = torch .jit .script (maceforce )
315
328
316
329
# Create the TorchForce and add it to the System.
317
- force = openmmtorch . TorchForce (module )
330
+ force = TorchForce (module )
318
331
force .setForceGroup (0 )
319
332
force .setUsesPeriodicBoundaryConditions (periodic )
320
333
system .addForce (force )
You can’t perform that action at this time.
0 commit comments