Skip to content

Commit

Permalink
Turn off the infer_residues in compound.py (#1135)
Browse files Browse the repository at this point in the history
* turn off the infer_residues in compound.py

* update unit test

* fix other unit test
  • Loading branch information
daico007 authored Jul 8, 2023
1 parent 54a6241 commit cea141e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mbuild/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -3234,7 +3234,7 @@ def to_parmed(
title="",
residues=None,
show_ports=False,
infer_residues=True,
infer_residues=False,
infer_residues_kwargs={},
):
"""Create a ParmEd Structure from a Compound.
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 @@ -1373,6 +1373,7 @@ def test_resnames_parmed(self, h2o, ethane):
system = Compound([h2o, mb.clone(h2o), ethane])
struct = system.to_parmed(
residues=["Ethane", "H2O"],
infer_residues=True,
)
assert len(struct.residues) == 3
assert struct.residues[0].name == "H2O"
Expand All @@ -1382,7 +1383,7 @@ def test_resnames_parmed(self, h2o, ethane):
struct.atoms
)

struct = system.to_parmed(residues="Ethane")
struct = system.to_parmed(residues="Ethane", infer_residues=True)
assert len(struct.residues) == 2
assert struct.residues[0].name == "RES"
assert struct.residues[1].name == "Ethane"
Expand Down Expand Up @@ -1458,7 +1459,7 @@ def test_resnames_parmed_cg(self, benzene, hexane, propyl):

# test multiple cg molecules
system = mb.Compound([mb.clone(cg), mb.clone(cg)])
struct = system.to_parmed()
struct = system.to_parmed(infer_residues=True)
assert len(struct.residues) == 2

# test hierarchical cg molecules to depth 1
Expand Down Expand Up @@ -1542,7 +1543,6 @@ def test_resnames_parmed_cg(self, benzene, hexane, propyl):
"include_base_level": True,
},
)
print(struct.residues)
# two_bonded beads should generate 8 residues (gets down to particle level) (16 total)
# benzene gets down to particle levels (24 total)
# hexane is goes from polymer down to monomer level. Made from two propyl groups which gives two monomers (4 total)
Expand Down

0 comments on commit cea141e

Please sign in to comment.