Skip to content

Commit

Permalink
remove rigid from conversion.py, update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Oct 28, 2024
1 parent 1379b3e commit 1b0fcb8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 452 deletions.
22 changes: 0 additions & 22 deletions mbuild/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def load(
relative_to_module=None,
compound=None,
coords_only=False,
rigid=False,
smiles=False,
infer_hierarchy=True,
backend=None,
Expand Down Expand Up @@ -68,8 +67,6 @@ def load(
will be added to the existing compound as a sub compound.
coords_only : bool, optional, default=False
Only load the coordinates into an existing compound.
rigid : bool, optional, default=False
Treat the compound as a rigid body
backend : str, optional, default=None
Backend used to load structure from file or string. If not specified, a
default backend (extension specific) will be used.
Expand Down Expand Up @@ -103,7 +100,6 @@ def load(
obj=filename_or_object,
compound=compound,
coords_only=coords_only,
rigid=rigid,
infer_hierarchy=infer_hierarchy,
**kwargs,
)
Expand All @@ -126,7 +122,6 @@ def load(
relative_to_module=relative_to_module,
compound=compound,
coords_only=coords_only,
rigid=rigid,
backend=backend,
infer_hierarchy=infer_hierarchy,
**kwargs,
Expand All @@ -137,7 +132,6 @@ def load_object(
obj,
compound=None,
coords_only=False,
rigid=False,
infer_hierarchy=True,
**kwargs,
):
Expand All @@ -156,8 +150,6 @@ def load_object(
The host mbuild Compound
coords_only : bool, optional, default=False
Only load the coordinates into existing compound.
rigid : bool, optional, default=False
Treat the compound as a rigid body
infer_hierarchy : bool, optional, default=True
If True, infer hiereachy from chains and residues
**kwargs : keyword arguments
Expand Down Expand Up @@ -200,8 +192,6 @@ def load_object(
infer_hierarchy=infer_hierarchy,
**kwargs,
)
if rigid:
compound.label_rigid_bodies()
return compound

# If nothing is return raise an error
Expand Down Expand Up @@ -323,7 +313,6 @@ def load_file(
relative_to_module=None,
compound=None,
coords_only=False,
rigid=False,
backend=None,
infer_hierarchy=True,
**kwargs,
Expand All @@ -348,8 +337,6 @@ def load_file(
will be added to the existing compound as a sub compound.
coords_only : bool, optional, default=False
Only load the coordinates into an existing compound.
rigid : bool, optional, default=False
Treat the compound as a rigid body
backend : str, optional, default=None
Backend used to load structure from file. If not specified, a default
backend (extension specific) will be used.
Expand Down Expand Up @@ -462,8 +449,6 @@ def load_file(
)
# Note: 'Input not supported' error will be handled
# by the corresponding backend
if rigid:
compound.label_rigid_bodies()
return compound


Expand Down Expand Up @@ -1199,7 +1184,6 @@ def to_hoomdsnapshot(
identify_connections=True,
ref_distance=1.0,
ref_mass=1.0,
rigid_bodies=None,
shift_coords=True,
write_special_pairs=True,
**kwargs,
Expand All @@ -1216,11 +1200,6 @@ def to_hoomdsnapshot(
Reference distance for conversion to reduced units
ref_mass : float, optional, default=1.0
Reference mass for conversion to reduced units
rigid_bodies : list of int, optional, default=None
List of rigid body information. An integer value is required for each
atom corresponding to the index of the rigid body the particle is to be
associated with. A value of None indicates the atom is not part of a
rigid body.
shift_coords : bool, optional, default=True
Shift coordinates from (0, L) to (-L/2, L/2) if necessary.
write_special_pairs : bool, optional, default=True
Expand Down Expand Up @@ -1249,7 +1228,6 @@ def to_hoomdsnapshot(
snapshot, refs = to_gsd_snapshot(
top=gmso_top,
base_units=base_units,
rigid_bodies=rigid_bodies,
shift_coords=shift_coords,
parse_special_pairs=write_special_pairs,
auto_scale=False,
Expand Down
6 changes: 3 additions & 3 deletions mbuild/tests/test_compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -2560,9 +2560,9 @@ def test_elements_from_smiles(self, backend):
for particle in mol.particles():
assert particle.element is not None

def test_mins_maxs(self, rigid_benzene):
assert np.allclose(rigid_benzene.mins, [-0.2267, -0.15422, 0.0])
assert np.allclose(rigid_benzene.maxs, [0.20318, 0.34207, 0.0])
def test_mins_maxs(self, ethane):
assert np.allclose(ethane.mins, [-0.10699999, -0.21690001, -0.0993])
assert np.allclose(ethane.maxs, [0.10699999, 0.07690001, 0.0653])

def test_periodicity_raises(self):
with pytest.raises(ValueError):
Expand Down
Loading

0 comments on commit 1b0fcb8

Please sign in to comment.