Skip to content

Commit

Permalink
add isrigid to molecule
Browse files Browse the repository at this point in the history
  • Loading branch information
daico007 committed Oct 16, 2023
1 parent 982a04d commit 904750f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions gmso/abc/abstract_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
from gmso.exceptions import GMSOError

try:
from pydantic.v1 import Field, StrictInt, StrictStr, validator
from pydantic.v1 import Field, StrictBool, StrictInt, StrictStr, validator
except ImportError:
from pydantic import Field, StrictInt, StrictStr, validator
from pydantic import Field, StrictBool, StrictInt, StrictStr, validator

PositionType = Union[Sequence[float], np.ndarray, u.unyt_array]
MoleculeType = NamedTuple("Molecule", name=StrictStr, number=StrictInt)
MoleculeType = NamedTuple(
"Molecule", name=StrictStr, number=StrictInt, isrigid=StrictBool
)
ResidueType = NamedTuple("Residue", name=StrictStr, number=StrictInt)

SiteT = TypeVar("SiteT", bound="Site")
Expand Down
2 changes: 1 addition & 1 deletion gmso/formats/top.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def write_top(top, filename, top_vars=None):
# Special treatment for water, may ned to consider a better way to tag rigid water
# Built using this https://github.com/gromacs/gromacs/blob/main/share/top/oplsaa.ff/spce.itp as reference
if "water" in tag.lower() and all(
"rigid" in site.label for site in unique_molecules[tag]["sites"]
site.molecule.isrigid for site in unique_molecules[tag]["sites"]
):
sites_list = unique_molecules[tag]["sites"]
water_sites = {
Expand Down

0 comments on commit 904750f

Please sign in to comment.