Skip to content

Commit 3d8a9aa

Browse files
committed
add more test cases for quip/gap/xyz
1 parent d87c34a commit 3d8a9aa

File tree

3 files changed

+130
-2
lines changed

3 files changed

+130
-2
lines changed

tests/test_quip_gap_xyz.py

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from context import dpdata
55
from comp_sys import CompLabeledSys
66

7-
class TestQuipGapxyz(unittest.TestCase, CompLabeledSys):
7+
class TestQuipGapxyz1(unittest.TestCase, CompLabeledSys):
88
def setUp (self) :
99
self.multi_systems = dpdata.MultiSystems.from_file('xyz/xyz_unittest.xyz','quip/gap/xyz')
1010
self.system_1 = self.multi_systems.systems['B1C9']
@@ -17,7 +17,7 @@ def setUp (self) :
1717
class TestQuipGapxyz2(unittest.TestCase, CompLabeledSys):
1818
def setUp (self) :
1919
self.system_temp0 = dpdata.MultiSystems.from_file(file_name='xyz/xyz_unittest.xyz', fmt='quip/gap/xyz')
20-
self.system_1 = self.system_temp0.systems['B5C7']
20+
self.system_1 = self.system_temp0.systems['B5C7'] # .sort_atom_types()
2121
self.system_temp1 = dpdata.LabeledSystem('xyz/B1C9', fmt='deepmd')
2222
self.system_temp2 = dpdata.LabeledSystem('xyz/B5C7', fmt='deepmd')
2323
self.system_temp3 = dpdata.MultiSystems(self.system_temp2, self.system_temp1)
@@ -27,5 +27,54 @@ def setUp (self) :
2727
self.f_places = 6
2828
self.v_places = 4
2929

30+
class TestQuipGapxyzsort1(unittest.TestCase, CompLabeledSys):
31+
def setUp (self) :
32+
self.multi_systems_1 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.sort.xyz','quip/gap/xyz')
33+
self.system_1 = self.multi_systems_1.systems['B5C7']
34+
self.system_1.sort_atom_types()
35+
self.multi_systems_2 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.xyz','quip/gap/xyz')
36+
self.system_2 = self.multi_systems_2.systems['B5C7']
37+
self.places = 6
38+
self.e_places = 6
39+
self.f_places = 6
40+
self.v_places = 4
41+
42+
class TestQuipGapxyzsort2(unittest.TestCase, CompLabeledSys):
43+
def setUp (self) :
44+
self.multi_systems_1 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.sort.xyz','quip/gap/xyz')
45+
self.system_1 = self.multi_systems_1.systems['B1C9']
46+
self.system_1.sort_atom_types()
47+
self.multi_systems_2 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.xyz','quip/gap/xyz')
48+
self.system_2 = self.multi_systems_2.systems['B1C9']
49+
self.places = 6
50+
self.e_places = 6
51+
self.f_places = 6
52+
self.v_places = 4
53+
54+
class TestQuipGapxyzfield(unittest.TestCase, CompLabeledSys):
55+
def setUp (self) :
56+
self.multi_systems_1 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.field.xyz','quip/gap/xyz')
57+
self.system_1 = self.multi_systems_1.systems['B1C9']
58+
self.system_1.sort_atom_types()
59+
self.multi_systems_2 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.xyz','quip/gap/xyz')
60+
self.system_2 = self.multi_systems_2.systems['B1C9']
61+
self.places = 6
62+
self.e_places = 6
63+
self.f_places = 6
64+
self.v_places = 4
65+
66+
class TestQuipGapxyzfield2(unittest.TestCase, CompLabeledSys):
67+
def setUp (self) :
68+
self.multi_systems_1 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.field.xyz','quip/gap/xyz')
69+
self.system_1 = self.multi_systems_1.systems['B5C7']
70+
self.system_1.sort_atom_types()
71+
self.multi_systems_2 = dpdata.MultiSystems.from_file('xyz/xyz_unittest.xyz','quip/gap/xyz')
72+
self.system_2 = self.multi_systems_2.systems['B5C7']
73+
self.places = 6
74+
self.e_places = 6
75+
self.f_places = 6
76+
self.v_places = 4
77+
78+
3079
if __name__ == '__main__':
3180
unittest.main()

tests/xyz/xyz_unittest.field.xyz

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# change field structure,table structure add quote and blank line
2+
12
3+
energy=0.2397023e+01 virial="159.582203018 1.23282341824e-05 0.187835167689 1.23282341824e-05 164.488614479 9.04070506711e-06 0.187835167689 9.04070506711e-06 300.596373102" Lattice="2.405388711 0.0 0.0 6.67e-07 8.830761667 0.0 2.145883783 6.3e-08 2.066179013" Properties=force:R:3:pos:R:3:species:S:1:Z:I:1
4+
-7.25565900000 -8.82919400000 4.68743200000 3.19567000000 0.97965000000 1.52250000000 B 5
5+
7.25565700000 -8.82919400000 -4.68743200000 1.35561000000 0.97965000000 0.54368000000 B 5
6+
7.25565900000 8.82919400000 -4.68743200000 1.35561000000 7.85111000000 0.54368000000 B 5
7+
-7.25565700000 8.82919400000 4.68743200000 3.19567000000 7.85111000000 1.52250000000 B 5
8+
-0.00000000000 0 +0.0 2.27564000000 4.41538000000 1.03309000000 B 5
9+
-14.39490800000 -19.12936600000 -4.67857200000 1.95905000000 6.23505000000 1.53936000000 C 6
10+
14.39490500000 -19.12936600000 4.67857200000 2.59222000000 6.23505000000 0.52682000000 C 6
11+
14.39490800000 19.12936600000 4.67857200000 2.59222000000 2.59571000000 0.52682000000 C 6
12+
-14.39490500000 19.12936600000 -4.67857200000 1.95905000000 2.59571000000 1.53936000000 C 6
13+
-0.00000000000 -4.51935800000 0 2.27564000000 1.56002000000 1.03309000000 C 6
14+
0.00000000000 4.51935800000 0 2.27564000000 7.27074000000 1.03309000000 C 6
15+
-0.00000000000 -0.00000000000 0 2.27564000000 0.00000000000 1.03309000000 C 6
16+
17+
18+
10
19+
virial=" -3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091 " Lattice=" 9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915 " Properties='species:S:1:pos:R:3:Z:I:1:force:R:3 ' energy='-58.342497 '
20+
B 12.38023000000 3.21563000000 2.13103000000 5 -9.35551000000 -0.00000000000 -0.22364600000
21+
C 12.96783000000 4.32879000000 2.14172000000 6 7.05653600000 11.19171000000 1.80087100000
22+
C 12.96783000000 2.10247000000 2.14172000000 6 7.05653500000 -11.19171000000 1.80087100000
23+
C 7.95424000000 1.03482000000 2.10290000000 6 1.71010500000 -3.80357800000 -0.12402100000
24+
C 7.95424000000 5.39645000000 2.10290000000 6 1.71010600000 3.80357800000 -0.12402100000
25+
C 0.48970000000 5.37868000000 0.03690000000 6 0.43541500000 0.75339500000 -0.62086800000
26+
C 0.48970000000 1.05259000000 0.03690000000 6 0.43541500000 -0.75339500000 -0.62086800000
27+
C 2.71900000000 1.71197000000 0.17210000000 6 -3.43041200000 0.05665700000 -0.44035700000
28+
C 2.71900000000 4.71930000000 0.17210000000 6 -3.43041200000 -0.05665700000 -0.44035700000
29+
C 9.69981000000 3.21563000000 0.55395000000 6 -2.18778000000 -0.00000000000 -1.00760300000
30+
10
31+
energy=-56.397425 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
32+
B 4.08581000000 4.57623000000 2.94238000000 5 0.03989300000 -1.87257900000 0.97202400000
33+
C 1.42627000000 0.93584000000 2.94238000000 5 -0.03989300000 1.87257900000 0.97202400000
34+
C 0.93584000000 4.08581000000 2.94238000000 5 1.87257900000 0.03989300000 0.97202400000
35+
C 4.57623000000 1.42627000000 2.94238000000 5 -1.87257900000 -0.03989300000 0.97202400000
36+
C 2.75604000000 2.75604000000 0.32076000000 5 -0.00000000000 -0.00000000000 -1.59707500000
37+
C 2.94936000000 1.19711000000 3.32090000000 6 0.74133300000 -2.43841400000 -2.33370300000
38+
C 2.56271000000 4.31496000000 3.32090000000 6 -0.74133400000 2.43841400000 -2.33370300000
39+
C 4.31496000000 2.94936000000 3.32090000000 6 2.43841400000 0.74133400000 -2.33370300000
40+
C 1.19711000000 2.56271000000 3.32090000000 6 -2.43841400000 -0.74133400000 -2.33370300000
41+
C 2.75604000000 2.75604000000 1.72073000000 6 0.00000100000 0.00000100000 7.04379200000

tests/xyz/xyz_unittest.sort.xyz

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
12
2+
energy=2.397023 virial="159.582203018 1.23282341824e-05 0.187835167689 1.23282341824e-05 164.488614479 9.04070506711e-06 0.187835167689 9.04070506711e-06 300.596373102" Lattice="2.405388711 0.0 0.0 6.67e-07 8.830761667 0.0 2.145883783 6.3e-08 2.066179013" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
3+
C 1.95905000000 6.23505000000 1.53936000000 6 -14.39490800000 -19.12936600000 -4.67857200000
4+
B 3.19567000000 0.97965000000 1.52250000000 5 -7.25565900000 -8.82919400000 4.68743200000
5+
B 1.35561000000 0.97965000000 0.54368000000 5 7.25565700000 -8.82919400000 -4.68743200000
6+
B 1.35561000000 7.85111000000 0.54368000000 5 7.25565900000 8.82919400000 -4.68743200000
7+
C 2.59222000000 6.23505000000 0.52682000000 6 14.39490500000 -19.12936600000 4.67857200000
8+
C 2.59222000000 2.59571000000 0.52682000000 6 14.39490800000 19.12936600000 4.67857200000
9+
C 1.95905000000 2.59571000000 1.53936000000 6 -14.39490500000 19.12936600000 -4.67857200000
10+
C 2.27564000000 1.56002000000 1.03309000000 6 -0.00000000000 -4.51935800000 0.00000000000
11+
C 2.27564000000 7.27074000000 1.03309000000 6 0.00000000000 4.51935800000 0.00000000000
12+
B 3.19567000000 7.85111000000 1.52250000000 5 -7.25565700000 8.82919400000 4.68743200000
13+
C 2.27564000000 0.00000000000 1.03309000000 6 -0.00000000000 -0.00000000000 0.00000000000
14+
B 2.27564000000 4.41538000000 1.03309000000 5 -0.00000000000 -0.00000000000 0.00000000000
15+
10
16+
energy=-58.342497 virial="-3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091" Lattice="9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
17+
C 12.96783000000 4.32879000000 2.14172000000 6 7.05653600000 11.19171000000 1.80087100000
18+
C 12.96783000000 2.10247000000 2.14172000000 6 7.05653500000 -11.19171000000 1.80087100000
19+
C 7.95424000000 1.03482000000 2.10290000000 6 1.71010500000 -3.80357800000 -0.12402100000
20+
C 7.95424000000 5.39645000000 2.10290000000 6 1.71010600000 3.80357800000 -0.12402100000
21+
B 12.38023000000 3.21563000000 2.13103000000 5 -9.35551000000 -0.00000000000 -0.22364600000
22+
C 0.48970000000 5.37868000000 0.03690000000 6 0.43541500000 0.75339500000 -0.62086800000
23+
C 0.48970000000 1.05259000000 0.03690000000 6 0.43541500000 -0.75339500000 -0.62086800000
24+
C 2.71900000000 1.71197000000 0.17210000000 6 -3.43041200000 0.05665700000 -0.44035700000
25+
C 2.71900000000 4.71930000000 0.17210000000 6 -3.43041200000 -0.05665700000 -0.44035700000
26+
C 9.69981000000 3.21563000000 0.55395000000 6 -2.18778000000 -0.00000000000 -1.00760300000
27+
10
28+
energy=-56.397425 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
29+
B 4.08581000000 4.57623000000 2.94238000000 5 0.03989300000 -1.87257900000 0.97202400000
30+
C 1.42627000000 0.93584000000 2.94238000000 5 -0.03989300000 1.87257900000 0.97202400000
31+
C 0.93584000000 4.08581000000 2.94238000000 5 1.87257900000 0.03989300000 0.97202400000
32+
C 4.57623000000 1.42627000000 2.94238000000 5 -1.87257900000 -0.03989300000 0.97202400000
33+
C 2.75604000000 2.75604000000 0.32076000000 5 -0.00000000000 -0.00000000000 -1.59707500000
34+
C 2.94936000000 1.19711000000 3.32090000000 6 0.74133300000 -2.43841400000 -2.33370300000
35+
C 2.56271000000 4.31496000000 3.32090000000 6 -0.74133400000 2.43841400000 -2.33370300000
36+
C 4.31496000000 2.94936000000 3.32090000000 6 2.43841400000 0.74133400000 -2.33370300000
37+
C 1.19711000000 2.56271000000 3.32090000000 6 -2.43841400000 -0.74133400000 -2.33370300000
38+
C 2.75604000000 2.75604000000 1.72073000000 6 0.00000100000 0.00000100000 7.04379200000

0 commit comments

Comments
 (0)