Skip to content

Commit

Permalink
fix _parse_pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Oct 17, 2024
1 parent a72d898 commit 5e8635f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions gmso/external/convert_hoomd.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,11 @@ def _parse_pairs_information(snapshot, top, n_rigid=0):
snapshot.pairs.group[:] = np.reshape(pairs, (-1, 2))
snapshot.pairs.types = pair_types
snapshot.pairs.typeid[:] = pair_typeids
if n_rigid:
snapshot.pairs.group += n_rigid
elif isinstance(snapshot, gsd.hoomd.Frame):
snapshot.pairs.N = len(pairs)
snapshot.pairs.group = np.reshape(pairs, (-1, 2))
snapshot.pairs.types = pair_types
snapshot.pairs.typeid = pair_typeids
if n_rigid:
snapshot.pairs.group += n_rigid


def _parse_bond_information(snapshot, top, n_rigid=0):
Expand Down
2 changes: 1 addition & 1 deletion gmso/tests/test_hoomd.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_rigid_bodies(self):
assert snapshot.bonds.N == snapshot_no_rigid.bonds.N
assert snapshot.angles.N == snapshot_no_rigid.angles.N
assert snapshot.dihedrals.N == snapshot_no_rigid.dihedrals.N
# Check that particle indices in snapshot groups are adjust by num rigid bodies
# Check if particle indices in snapshot groups are adjusted by N rigid bodies
for group1, group2 in zip(snapshot.bonds.group, snapshot_no_rigid.bonds.group):
assert np.array_equal(np.array(group1), np.array(group2) + 2)
for group1, group2 in zip(
Expand Down

0 comments on commit 5e8635f

Please sign in to comment.