File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -964,7 +964,12 @@ def predict(self, dp):
964
964
labeled_sys LabeledSystem
965
965
The labeled system.
966
966
"""
967
- import deepmd .DeepPot as DeepPot
967
+ try :
968
+ # DP 1.x
969
+ import deepmd .DeepPot as DeepPot
970
+ except ModuleNotFoundError :
971
+ # DP 2.x
972
+ from deepmd .infer import DeepPot
968
973
if not isinstance (dp , DeepPot ):
969
974
dp = DeepPot (dp )
970
975
type_map = dp .get_type_map ()
@@ -1800,7 +1805,12 @@ def from_deepmd_npy(self, folder):
1800
1805
return self
1801
1806
1802
1807
def predict (self , dp ):
1803
- import deepmd .DeepPot as DeepPot
1808
+ try :
1809
+ # DP 1.x
1810
+ import deepmd .DeepPot as DeepPot
1811
+ except ModuleNotFoundError :
1812
+ # DP 2.x
1813
+ from deepmd .infer import DeepPot
1804
1814
if not isinstance (dp , DeepPot ):
1805
1815
dp = DeepPot (dp )
1806
1816
new_multisystems = dpdata .MultiSystems ()
You can’t perform that action at this time.
0 commit comments