Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra gmso #756

Merged
merged 52 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
665feb6
Add fixed length bonds and angles to potential templates library.
rsdefever Jun 24, 2021
bd6ad75
Working to make MCF writer feature complete. Tests in progress.
rsdefever Jun 24, 2021
a6ce48d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 24, 2021
a97826c
Add dimensions to Fixed Bond and Angle templates
emarinri Aug 11, 2023
c9bd1d1
Update keys in OPLS dihedral parameters dict
emarinri Aug 11, 2023
014b7ae
Fix typed OPLS ethane test for MCF format
emarinri Aug 11, 2023
f41d5a9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 11, 2023
f8e044c
Add typed ethane test.
emarinri Aug 13, 2023
059ee03
Fix code style
emarinri Aug 13, 2023
48fd600
Add fixture to parse mcf into sections
emarinri Aug 13, 2023
aed4c44
Support Pydantic v1 and v2 (#752)
mattwthompson Aug 11, 2023
76415a8
Update MCF with GMSO builtin top site sorting
emarinri Aug 15, 2023
f093262
Use PotentialFilters to check for unique atomtypes
emarinri Aug 15, 2023
44a0928
Add test to check charge neutrality
emarinri Aug 15, 2023
b9efc1b
Add test for incompatible expressions
emarinri Aug 15, 2023
f9f2759
Test full MCF for Mie-Xe and LJ-Ar
emarinri Aug 16, 2023
5442297
Check charge neutrality in each molecule test
emarinri Aug 16, 2023
86902e6
Add exception for not neutral system in MCF writer
emarinri Aug 16, 2023
00cc2bc
Move parsing and neutrality check as utils
emarinri Aug 17, 2023
73d24de
Merge branch 'main' into cassandra-gmso
daico007 Sep 2, 2023
6094aba
Merge branch 'main' into cassandra-gmso
daico007 Sep 6, 2023
51fdad8
minor docstring/comment fixes, swap out simplify with symengine expand
daico007 Sep 11, 2023
5f4ca3c
Merge branch 'main' of https://github.com/mosdef-hub/gmso into cassan…
daico007 Sep 11, 2023
1dc0a3e
[pre-commit.ci] pre-commit autoupdate (#763)
pre-commit-ci[bot] Sep 12, 2023
a1c3fb5
Test for 0.5 factor of OPLS dihedral potential
emarinri Sep 12, 2023
4578812
Test to account for 0.5 factor in harmonic angles
emarinri Sep 12, 2023
6668363
Test for rigid angles using the TIP3P model
emarinri Sep 12, 2023
80c9be3
MCF writer test with topology with 10 argon mols
emarinri Sep 13, 2023
2b0c7ee
Tentative output of multiple MCF from one Topology
emarinri Sep 13, 2023
8317de4
Merge branch 'main' into cassandra-gmso
daico007 Sep 13, 2023
3951954
Change psi to phi and consts for ethylene xml test
emarinri Sep 14, 2023
9579252
Test for 0.5 factor in OPLS dihedrals
emarinri Sep 14, 2023
ae69a8c
Add cassandra test for gmso
CalCraven Sep 18, 2023
750d755
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 18, 2023
a7df9bc
Add test for two atom fragment
emarinri Sep 16, 2023
685f8b8
Test for molecule with one ring
emarinri Sep 16, 2023
1252d2b
Change nitrogen test to ethane ua
emarinri Sep 19, 2023
ec3a5dd
Add ethane rigid reference xml
emarinri Sep 19, 2023
a30d7bd
Use Fourier dihedrals as MCF standard dihedrals.
emarinri Sep 19, 2023
64b5b8f
Fix dihedral type output fourier to opls
emarinri Sep 19, 2023
ad68575
Match MCF GMSO Angle header to mb Angle header
emarinri Sep 20, 2023
0759365
Add a test comparing gmso and mbuild mcf writers
emarinri Sep 20, 2023
cf4e0c0
Use the Fourier converter for ethylene dihedrals
emarinri Sep 20, 2023
f462d5b
Write atom type masses instead of atom masses to account for UA beads
emarinri Sep 20, 2023
2a40bbf
Output correct case for dihedral styles in MCFs
emarinri Sep 20, 2023
c12a120
Merge branch 'main' into cassandra-gmso
daico007 Sep 20, 2023
6ff41e2
Merge branch 'cassandra-gmso' of https://github.com/emarinri/gmso int…
emarinri Sep 20, 2023
c1b9c19
Run an energy calculation to compare GMSO and mBuild MCF writers
emarinri Sep 20, 2023
dcdc342
Merge branch 'main' into cassandra-gmso
daico007 Sep 21, 2023
3c12947
Update gmso/tests/test_mcf.py
daico007 Sep 21, 2023
a1f4853
Update gmso/tests/test_mcf.py
daico007 Sep 21, 2023
f38cfb6
Merge branch 'main' into cassandra-gmso
daico007 Sep 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
pydantic-version: ["1", "2"]

defaults:
run:
Expand All @@ -33,7 +34,9 @@ jobs:
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
python-version: python=${{ matrix.python-version }}
create-args: >-
python=${{ matrix.python-version }}
pydantic=${{ matrix.pydantic-version }}

- name: Install Package
run: python -m pip install -e .
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- unyt<=2.9.2
- boltons
- lxml
- pydantic=1.10.11
- pydantic
- networkx
- pytest
- mbuild>=0.11.0
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- unyt<=2.9.2
- boltons
- lxml
- pydantic=1.10.11
- pydantic
- networkx
- ele>=0.2.0
- foyer>=0.11.3
Expand Down
7 changes: 5 additions & 2 deletions gmso/abc/abstract_connection.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from typing import Optional, Sequence

from pydantic import Field, root_validator

from gmso.abc.abstract_site import Site
from gmso.abc.gmso_base import GMSOBase
from gmso.exceptions import GMSOError

try:
from pydantic.v1 import Field, root_validator
except ImportError:
from pydantic import Field, root_validator


class Connection(GMSOBase):
__base_doc__ = """An abstract class that stores data about connections between sites.
Expand Down
7 changes: 5 additions & 2 deletions gmso/abc/abstract_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
from abc import abstractmethod
from typing import Any, Dict, Iterator, List

from pydantic import Field, validator

from gmso.abc.gmso_base import GMSOBase
from gmso.utils.expression import PotentialExpression

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


class AbstractPotential(GMSOBase):
__base_doc__ = """An abstract potential class.
Expand Down
6 changes: 5 additions & 1 deletion gmso/abc/abstract_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

import numpy as np
import unyt as u
from pydantic import Field, StrictInt, StrictStr, validator
from unyt.exceptions import InvalidUnitOperation

from gmso.abc.gmso_base import GMSOBase
from gmso.exceptions import GMSOError

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

PositionType = Union[Sequence[float], np.ndarray, u.unyt_array]
MoleculeType = NamedTuple("Molecule", name=StrictStr, number=StrictInt)
ResidueType = NamedTuple("Residue", name=StrictStr, number=StrictInt)
Expand Down
5 changes: 4 additions & 1 deletion gmso/abc/auto_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple, Type, Union

from pydantic import BaseModel
try:
from pydantic.v1 import BaseModel
except ImportError:
from pydantic import BaseModel

BASE_DOC_ATTR = "__base_doc__"
FIELDS_IN_DOCSTRING = "__alias_to_fields__"
Expand Down
10 changes: 7 additions & 3 deletions gmso/abc/gmso_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
from abc import ABC
from typing import Any, ClassVar, Type

from pydantic import BaseModel
from pydantic.validators import dict_validator

from gmso.abc import GMSOJSONHandler
from gmso.abc.auto_doc import apply_docs
from gmso.abc.serialization_utils import dict_to_unyt

try:
from pydantic.v1 import BaseModel
from pydantic.v1.validators import dict_validator
except ImportError:
from pydantic import BaseModel
from pydantic.validators import dict_validator


class GMSOBase(BaseModel, ABC):
"""A BaseClass to all abstract classes in GMSO."""
Expand Down
7 changes: 5 additions & 2 deletions gmso/core/angle.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""Support for 3-partner connections between gmso.core.Atoms."""
from typing import Callable, ClassVar, Optional, Tuple

from pydantic import Field

from gmso.abc.abstract_connection import Connection
from gmso.core.angle_type import AngleType
from gmso.core.atom import Atom

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class Angle(Connection):
__base_doc__ = """A 3-partner connection between Atoms.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/angle_type.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
from typing import Optional, Tuple

import unyt as u
from pydantic import Field

from gmso.core.parametric_potential import ParametricPotential
from gmso.utils.expression import PotentialExpression

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class AngleType(ParametricPotential):
__base_doc__ = """A descripton of the interaction between 3 bonded partners.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
from typing import Optional, Union

import unyt as u
from pydantic import Field, validator

from gmso.abc.abstract_site import Site
from gmso.core.atom_type import AtomType
from gmso.core.element import Element
from gmso.utils._constants import UNIT_WARNING_STRING
from gmso.utils.misc import ensure_valid_dimensions

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


class Atom(Site):
__base_doc__ = """An atom represents a single element association in a topology.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/atom_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Optional, Set

import unyt as u
from pydantic import Field, validator

from gmso.core.parametric_potential import ParametricPotential
from gmso.utils._constants import UNIT_WARNING_STRING
Expand All @@ -14,6 +13,11 @@
unyt_to_hashable,
)

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


class AtomType(ParametricPotential):
__base_doc__ = """A description of non-bonded interactions between sites.
Expand Down
7 changes: 5 additions & 2 deletions gmso/core/bond.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""Module for 2-partner connections between sites."""
from typing import Callable, ClassVar, Optional, Tuple

from pydantic import Field

from gmso.abc.abstract_connection import Connection
from gmso.core.atom import Atom
from gmso.core.bond_type import BondType

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class Bond(Connection):
__base_doc__ = """A 2-partner connection between sites.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/bond_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
from typing import Optional, Tuple

import unyt as u
from pydantic import Field

from gmso.core.parametric_potential import ParametricPotential
from gmso.utils.expression import PotentialExpression

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class BondType(ParametricPotential):
__base_doc__ = """A descripton of the interaction between 2 bonded partners.
Expand Down
7 changes: 5 additions & 2 deletions gmso/core/dihedral.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from typing import Callable, ClassVar, Optional, Tuple

from pydantic import Field

from gmso.abc.abstract_connection import Connection
from gmso.core.atom import Atom
from gmso.core.dihedral_type import DihedralType

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class Dihedral(Connection):
__base_doc__ = """A 4-partner connection between sites.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/dihedral_type.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
from typing import Optional, Tuple

import unyt as u
from pydantic import Field

from gmso.core.parametric_potential import ParametricPotential
from gmso.utils.expression import PotentialExpression

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class DihedralType(ParametricPotential):
__base_doc__ = """A descripton of the interaction between 4 bonded partners.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
import numpy as np
import unyt as u
from pkg_resources import resource_filename
from pydantic import Field

from gmso.abc.gmso_base import GMSOBase
from gmso.exceptions import GMSOError
from gmso.utils.misc import unyt_to_hashable

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field

exported = [
"element_by_mass",
"element_by_symbol",
Expand Down
7 changes: 5 additions & 2 deletions gmso/core/improper.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""Support for improper style connections (4-member connection)."""
from typing import Callable, ClassVar, Optional, Tuple

from pydantic import Field

from gmso.abc.abstract_connection import Connection
from gmso.core.atom import Atom
from gmso.core.improper_type import ImproperType

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class Improper(Connection):
__base_doc__ = """sA 4-partner connection between sites.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/improper_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
from typing import Optional, Tuple

import unyt as u
from pydantic import Field

from gmso.core.parametric_potential import ParametricPotential
from gmso.utils.expression import PotentialExpression

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class ImproperType(ParametricPotential):
__base_doc__ = """A description of the interaction between 4 bonded partners.
Expand Down
6 changes: 5 additions & 1 deletion gmso/core/pairpotential_type.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
from typing import Optional, Tuple

import unyt as u
from pydantic import Field

from gmso.core.parametric_potential import ParametricPotential
from gmso.utils.expression import PotentialExpression

try:
from pydantic.v1 import Field
except ImportError:
from pydantic import Field


class PairPotentialType(ParametricPotential):
__base_doc__ = """A description of custom pairwise potential between 2 AtomTypes that does not follow combination rule.
Expand Down
Loading