Skip to content

Commit

Permalink
remove rigid id from convert mbuild, remove rigid id prop from abstra…
Browse files Browse the repository at this point in the history
…ct site
  • Loading branch information
chrisjonesBSU committed Sep 25, 2024
1 parent 60e3538 commit 8842973
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
11 changes: 0 additions & 11 deletions gmso/abc/abstract_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,6 @@ def __repr__(self):
alias="position",
)

rigid_id_: Optional[int] = Field(
None,
description="Rigid body ID used to assign rigid body contraints in HOOMD-Blue topologies.",
alias="rigid_id",
)

model_config = ConfigDict(
alias_to_fields={
"name": "name_",
Expand Down Expand Up @@ -267,11 +261,6 @@ def residue(self):
"""Return the residue assigned to the site."""
return self.__dict__.get("residue_")

@property
def rigid_id(self):
"""Return the rigid body ID for this atom."""
return self.__dict__.get("rigid_id_")

@field_serializer("position_")
def serialize_position(self, position_: PositionType):
return unyt_to_dict(position_)
Expand Down
2 changes: 0 additions & 2 deletions gmso/external/convert_mbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def _parse_particle(particle_map, site):
charge=charge,
mass=mass,
)
particle.rigid_id = site.rigid_id
particle_map[site] = particle
return particle

Expand All @@ -273,7 +272,6 @@ def _parse_site(site_map, particle, search_method, infer_element=False):
element=ele,
charge=charge,
mass=mass,
rigid_id=particle.rigid_id,
molecule=site_map[particle]["molecule"],
residue=site_map[particle]["residue"],
group=site_map[particle]["group"],
Expand Down
11 changes: 0 additions & 11 deletions gmso/tests/test_convert_mbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,3 @@ 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 8842973

Please sign in to comment.