Skip to content

Commit b1025b4

Browse files
committed
register functions automatically
1 parent a3e76d7 commit b1025b4

File tree

18 files changed

+16
-40
lines changed

18 files changed

+16
-40
lines changed

dpdata/plugins/abacus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
@Format.register("abacus/scf")
6-
@Format.register_from("from_abacus_pw_scf")
6+
@Format.register("abacus/pw/scf")
77
class AbacusSCFFormat(Format):
88
@Format.post("rot_lower_triangular")
99
def from_labeled_system(self, file_name, **kwargs):

dpdata/plugins/amber.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
@Format.register("amber/md")
7-
@Format.register_from("from_amber_md")
87
class AmberMDFormat(Format):
98
def from_system(self, file_name=None, parm7_file=None, nc_file=None, use_element_symbols=None):
109
# assume the prefix is the same if the spefic name is not given
@@ -30,7 +29,6 @@ def from_labeled_system(self, file_name=None, parm7_file=None, nc_file=None, mdf
3029

3130

3231
@Format.register("sqm/out")
33-
@Format.register_from("from_sqm_out")
3432
class SQMOutFormat(Format):
3533
def from_system(self, fname, **kwargs):
3634
'''

dpdata/plugins/ase.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
@Format.register("ase/structure")
5-
@Format.register_to("to_ase_structure")
65
class ASEStructureFormat(Format):
76
def to_system(self, data, **kwargs):
87
'''

dpdata/plugins/cp2k.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
@Format.register("cp2k/aimd_output")
8-
@Format.register_from("from_cp2k_aimd_output")
98
class CP2KAIMDOutputFormat(Format):
109
def from_labeled_system(self, file_name, restart=False, **kwargs):
1110
xyz_file = sorted(glob.glob("{}/*pos*.xyz".format(file_name)))[0]
@@ -14,7 +13,6 @@ def from_labeled_system(self, file_name, restart=False, **kwargs):
1413

1514

1615
@Format.register("cp2k/output")
17-
@Format.register_from("from_cp2k_output")
1816
class CP2KOutputFormat(Format):
1917
def from_labeled_system(self, file_name, restart=False, **kwargs):
2018
data = {}

dpdata/plugins/deepmd.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
@Format.register("deepmd")
88
@Format.register("deepmd/raw")
9-
@Format.register_from("from_deepmd_raw")
10-
@Format.register_to("to_deepmd_raw")
119
class DeePMDRawFormat(Format):
1210
def from_system(self, file_name, type_map=None, **kwargs):
1311
return dpdata.deepmd.raw.to_system_data(file_name, type_map=type_map, labels=False)
@@ -24,10 +22,7 @@ def from_labeled_system(self, file_name, type_map, **kwargs):
2422

2523

2624
@Format.register("deepmd/npy")
27-
@Format.register_from("from_deepmd_comp")
28-
@Format.register_from("from_deepmd_npy")
29-
@Format.register_to("to_deepmd_comp")
30-
@Format.register_to("to_deepmd_npy")
25+
@Format.register("deepmd/comp")
3126
class DeePMDCompFormat(Format):
3227
def from_system(self, file_name, type_map=None, **kwargs):
3328
return dpdata.deepmd.comp.to_system_data(file_name, type_map=type_map, labels=False)

dpdata/plugins/fhi_aims.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from dpdata.format import Format
33

44
@Format.register("fhi_aims/md")
5-
@Format.register_from("from_fhi_aims_output")
5+
@Format.register("fhi_aims/output")
66
class FhiMDFormat(Format):
77
def from_labeled_system(self, file_name, md=True, begin = 0, step = 1, **kwargs):
88
data = {}
@@ -20,7 +20,6 @@ def from_labeled_system(self, file_name, md=True, begin = 0, step = 1, **kwargs)
2020
return data
2121

2222
@Format.register("fhi_aims/scf")
23-
@Format.register_from("from_fhi_aims_output")
2423
class FhiSCFFormat(Format):
2524
def from_labeled_system(self, file_name, **kwargs):
2625
data = {}

dpdata/plugins/gaussian.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
@Format.register("gaussian/log")
6-
@Format.register_from("from_gaussian_log")
76
class GaussianLogFormat(Format):
87
def from_labeled_system(self, file_name, md=False, **kwargs):
98
try:
@@ -17,7 +16,6 @@ def from_labeled_system(self, file_name, md=False, **kwargs):
1716

1817

1918
@Format.register("gaussian/md")
20-
@Format.register_from("from_gaussian_md")
2119
class GaussianMDFormat(Format):
2220
def from_labeled_system(self, file_name, **kwargs):
2321
return GaussianLogFormat().from_labeled_system(file_name, md=True)

dpdata/plugins/gromacs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
@Format.register("gro")
66
@Format.register("gromacs/gro")
7-
@Format.register_from("from_gromacs_gro")
8-
@Format.register_to("to_gromacs_gro")
97
class PwmatOutputFormat(Format):
108
def from_system(self, file_name, format_atom_name=True, **kwargs):
119
"""

dpdata/plugins/lammps.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
@Format.register("lmp")
77
@Format.register("lammps/lmp")
8-
@Format.register_from("from_lammps_lmp")
9-
@Format.register_to("to_lammps_lmp")
108
class LAMMPSLmpFormat(Format):
119
@Format.post("shift_orig_zero")
1210
def from_system(self, file_name, type_map=None, **kwargs):
@@ -35,8 +33,6 @@ def to_system(self, data, file_name, frame_idx=0, **kwargs):
3533

3634
@Format.register("dump")
3735
@Format.register("lammps/dump")
38-
@Format.register_from("from_lammps_dump")
39-
@Format.register_to("to_lammps_dump")
4036
class LAMMPSDumpFormat(Format):
4137
@Format.post("shift_orig_zero")
4238
def from_system(self,

dpdata/plugins/list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
@Format.register("list")
5-
@Format.register_to("to_list")
65
class ListFormat(Format):
76
def to_system(self, data, **kwargs):
87
"""

0 commit comments

Comments
 (0)