@@ -15,6 +15,39 @@ def test_mlmd(self) :
15
15
self .assertEqual (self .LabeledSystem1 ['energies' ], - 0.2197270691E+03 )
16
16
self .assertEqual (self .LabeledSystem1 .get_nframes (), 1 )
17
17
self .assertEqual (self .LabeledSystem1 .get_natoms (), 5 )
18
+ self .assertEqual (self .LabeledSystem1 .data ['atom_names' ], ['H' , 'C' ])
19
+ self .assertEqual (self .LabeledSystem1 .data ['atom_numbs' ], [4 , 1 ])
20
+ def test_cell (self ) :
21
+ fp = open ('pwmat/mlmd_cell' )
22
+ cell = []
23
+ for ii in fp :
24
+ cell .append ([float (jj ) for jj in ii .split ()])
25
+ cell = np .array (cell )
26
+ for ii in range (cell .shape [0 ]) :
27
+ for jj in range (cell .shape [1 ]) :
28
+ self .assertEqual (self .LabeledSystem1 .data ['cells' ][0 ][ii ][jj ], cell [ii ][jj ])
29
+ fp .close ()
30
+
31
+ def test_coord (self ) :
32
+ fp = open ('pwmat/mlmd_coord' )
33
+ coord = []
34
+ for ii in fp :
35
+ coord .append ([float (jj ) for jj in ii .split ()])
36
+ coord = np .array (coord )
37
+ for ii in range (coord .shape [0 ]) :
38
+ for jj in range (coord .shape [1 ]) :
39
+ self .assertEqual (self .LabeledSystem1 .data ['coords' ][0 ][ii ][jj ], coord [ii ][jj ]* 10.0 )
40
+ fp .close ()
41
+ def test_force (self ) :
42
+ fp = open ('pwmat/mlmd_force' )
43
+ force = []
44
+ for ii in fp :
45
+ force .append ([float (jj ) for jj in ii .split ()])
46
+ force = np .array (force )
47
+ for ii in range (force .shape [0 ]) :
48
+ for jj in range (force .shape [1 ]) :
49
+ self .assertEqual (self .LabeledSystem1 .data ['forces' ][0 ][ii ][jj ], force [ii ][jj ])
50
+ fp .close ()
18
51
19
52
20
53
0 commit comments