File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import dpdata
66import numpy as np
7- from dpdata .abacus .stru import make_unlabeled_stru
7+ try :
8+ from dpdata .formats .abacus .stru import make_unlabeled_stru
9+ from dpdata .formats .vasp import poscar as dpdata_poscar
10+ except ModuleNotFoundError :
11+ from dpdata .abacus .stru import make_unlabeled_stru
12+ from dpdata .vasp import poscar as dpdata_poscar
13+
814from dpdata .utils import uniq_atom_names
9- from dpdata .vasp import poscar as dpdata_poscar
1015
1116import dpgen .generator .lib .abacus_scf as abacus_scf
1217
Original file line number Diff line number Diff line change 33import re
44
55import numpy as np
6- from dpdata .abacus .stru import get_frame_from_stru , make_unlabeled_stru
6+ try :
7+ from dpdata .formats .abacus .stru import get_frame_from_stru , make_unlabeled_stru
8+ except ModuleNotFoundError :
9+ from dpdata .abacus .stru import get_frame_from_stru , make_unlabeled_stru
710
811from dpgen .auto_test .lib import vasp
912
Original file line number Diff line number Diff line change 3030
3131import dpdata
3232import numpy as np
33+
34+ try :
35+ from dpdata .formats .siesta import output as dpdata_siesta_output
36+ except ModuleNotFoundError :
37+ from dpdata .siesta import output as dpdata_siesta_output
3338import scipy .constants as pc
3439from numpy .linalg import norm
3540from packaging .version import Version
@@ -4585,9 +4590,10 @@ def post_fp_abacus_scf(iter_index, jdata):
45854590
45864591 all_sys = None
45874592 for ii , oo in zip (sys_input , sys_output ):
4588- _sys = dpdata .LabeledSystem (
4589- oo , fmt = "abacus/scf" , type_map = jdata ["type_map" ]
4590- )
4593+ _sys = dpdata .LabeledSystem (oo , fmt = "abacus/scf" )
4594+ if len (_sys ) > 0 :
4595+ _sys .data ["atom_types" ] = np .asarray (_sys .data ["atom_types" ], dtype = int )
4596+ _sys .apply_type_map (jdata ["type_map" ])
45914597 if len (_sys ) > 0 :
45924598 if all_sys is None :
45934599 all_sys = _sys
@@ -4636,7 +4642,7 @@ def post_fp_siesta(iter_index, jdata):
46364642 _sys .data ["energies" ],
46374643 _sys .data ["forces" ],
46384644 _sys .data ["virials" ],
4639- ) = dpdata . siesta . output .obtain_frame (oo )
4645+ ) = dpdata_siesta_output .obtain_frame (oo )
46404646 if idx == 0 :
46414647 all_sys = _sys
46424648 else :
You can’t perform that action at this time.
0 commit comments