File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -498,12 +498,24 @@ def get_frame_from_stru(stru):
498498 for i in atom_names :
499499 if i not in uniq_name :
500500 uniq_name .append (i )
501- uniq_atom_num .append (sum ([atom_numbs [j ] for j in range (len (atom_names )) if atom_names [j ] == i ]))
501+ uniq_atom_num .append (
502+ sum (
503+ [
504+ atom_numbs [j ]
505+ for j in range (len (atom_names ))
506+ if atom_names [j ] == i
507+ ]
508+ )
509+ )
502510 data = {
503511 "atom_names" : uniq_name ,
504512 "atom_numbs" : uniq_atom_num ,
505513 "atom_types" : np .array (
506- [uniq_name .index (atom_names [i ]) for i in range (len (atom_numbs )) for j in range (atom_numbs [i ])]
514+ [
515+ uniq_name .index (atom_names [i ])
516+ for i in range (len (atom_numbs ))
517+ for j in range (atom_numbs [i ])
518+ ]
507519 ),
508520 "masses" : np .array ([masses [atom_names .index (i )] for i in uniq_name ]),
509521 "pp_files" : [pp_files [atom_names .index (i )] for i in uniq_name ],
Original file line number Diff line number Diff line change @@ -281,7 +281,8 @@ def test_dump_stru_with_repeat_atomtype(self):
281281 with open ("STRU_tmp" ) as f :
282282 c = f .read ()
283283 self .assertTrue (
284- "ATOMIC_SPECIES\n C 12.000 C_ONCV_PBE-1.0.upf\n H 1.000 H_ONCV_PBE-1.0.upf" in c
284+ "ATOMIC_SPECIES\n C 12.000 C_ONCV_PBE-1.0.upf\n H 1.000 H_ONCV_PBE-1.0.upf"
285+ in c
285286 )
286287 self .assertTrue ("H\n 0.0\n 4\n " in c )
287288 os .remove ("STRU_tmp" )
You can’t perform that action at this time.
0 commit comments