From ab004935cc48d819b0d32ce4dc4af28811fe9e12 Mon Sep 17 00:00:00 2001 From: chrisjonesBSU Date: Wed, 18 Sep 2024 15:53:14 -0600 Subject: [PATCH] add test for rigid_id assignment --- gmso/tests/test_convert_mbuild.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gmso/tests/test_convert_mbuild.py b/gmso/tests/test_convert_mbuild.py index 7b7a9c44..97620756 100644 --- a/gmso/tests/test_convert_mbuild.py +++ b/gmso/tests/test_convert_mbuild.py @@ -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