Skip to content

Commit

Permalink
add test for rigid_id assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Sep 18, 2024
1 parent 62edfeb commit ab00493
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gmso/tests/test_convert_mbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,14 @@ def test_nontop_level_compound(self, mb_ethane):
cpd.add(mb_ethane)
with pytest.raises(AssertionError):
from_mbuild(mb_ethane)

def test_rigid_ids(self, mb_ethane):
box = mb.fill_box(mb_ethane, n_compounds=3, box=[2, 2, 2])
for i, child in enumerate(box.children):
for p in child.particles():
p.rigid_id = i

top = from_mbuild(box)
assert set([site.rigid_id for site in top.sites]) == {0, 1, 2}
for particle, site in zip(box.particles(), top.sites):
assert particle.rigid_id == site.rigid_id

0 comments on commit ab00493

Please sign in to comment.