File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -282,8 +282,8 @@ def sub_system(self, f_idx) :
282
282
tmp = System ()
283
283
for ii in ['atom_numbs' , 'atom_names' , 'atom_types' , 'orig' ] :
284
284
tmp .data [ii ] = self .data [ii ]
285
- tmp .data ['cells' ] = self .data ['cells' ][f_idx ]
286
- tmp .data ['coords' ] = self .data ['coords' ][f_idx ]
285
+ tmp .data ['cells' ] = self .data ['cells' ][f_idx ]. reshape ( - 1 , 3 , 3 )
286
+ tmp .data ['coords' ] = self .data ['coords' ][f_idx ]. reshape ( - 1 , self . data [ 'coords' ]. shape [ 1 ], 3 )
287
287
return tmp
288
288
289
289
@@ -863,10 +863,10 @@ def sub_system(self, f_idx) :
863
863
"""
864
864
tmp_sys = LabeledSystem ()
865
865
tmp_sys .data = System .sub_system (self , f_idx ).data
866
- tmp_sys .data ['energies' ] = self .data ['energies' ][f_idx ]
867
- tmp_sys .data ['forces' ] = self .data ['forces' ][f_idx ]
866
+ tmp_sys .data ['energies' ] = np . atleast_1d ( self .data ['energies' ][f_idx ])
867
+ tmp_sys .data ['forces' ] = self .data ['forces' ][f_idx ]. reshape ( - 1 , self . data [ 'forces' ]. shape [ 1 ], 3 )
868
868
if 'virials' in self .data :
869
- tmp_sys .data ['virials' ] = self .data ['virials' ][f_idx ]
869
+ tmp_sys .data ['virials' ] = self .data ['virials' ][f_idx ]. reshape ( - 1 , 3 , 3 )
870
870
return tmp_sys
871
871
872
872
You can’t perform that action at this time.
0 commit comments