File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/nomad_simulation_parsers/parsers/lammps Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -500,8 +500,10 @@ def _extract_bond_list() -> None:
500500 if bonds is None or bonds [0 ][1 ].size == 0 :
501501 self ._bond_list = None
502502 else :
503- # Convert from List[Tuple[None, np.ndarray]] to List[Tuple[int, int]]
504- self ._bond_list = list (map (tuple , bonds [0 ][1 ][:, 2 :4 ].astype (int )))
503+ # Convert from 1-based (LAMMPS data file) to 0-based indexing (NOMAD)
504+ # Extract columns 2:4 (atom IDs), convert to int, subtract 1
505+ bond_array = bonds [0 ][1 ][:, 2 :4 ].astype (int ) - 1
506+ self ._bond_list = bond_array
505507
506508 for step in self .trajectory_steps :
507509 traj_n = self .trajectory_steps .index (step )
@@ -531,7 +533,7 @@ def _extract_bond_list() -> None:
531533 self .traj_parsers .eval ('get_positions' , traj_n ), 'distance'
532534 ),
533535 'velocities' : velocities ,
534- 'bond_list' : self ._bond_list if self ._bond_list else None ,
536+ 'bond_list' : self ._bond_list if self ._bond_list is not None else None ,
535537 'dimensions' : dimension ,
536538 }
537539 self .parse_trajectory_step (particles_dict , simulation )
You can’t perform that action at this time.
0 commit comments