Skip to content

Commit

Permalink
Merge branch 'main' into always-raise-keyboard-interrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemhenry authored Sep 1, 2023
2 parents 731f116 + 2028a63 commit 9146ea8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- pint <0.22 # https://github.com/openforcefield/openff-units/issues/69
- openff-models >=0.0.5
- pip
- pydantic <2.0.0
- pydantic <2
- pytest
- pytest-cov
- pytest-xdist
Expand Down
21 changes: 17 additions & 4 deletions gufe/settings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@
import abc
from typing import Optional, Union

import pydantic
from openff.models.models import DefaultModel
from openff.models.types import FloatQuantity
from openff.units import unit
from pydantic import Extra, Field, PositiveFloat

try:
from pydantic.v1 import (
Extra,
Field,
PositiveFloat,
validator,
)
except ImportError:
from pydantic import (
Extra,
Field,
PositiveFloat,
validator,
)


class SettingsBaseModel(DefaultModel):
Expand Down Expand Up @@ -53,7 +66,7 @@ class OpenMMSystemGeneratorFFSettings(BaseForceFieldSettings):
.. note::
Right now we just basically just grab what we need for the
:class:`openmmforcefields.system_generators.SystemGenerator`
:class:`openmmforcefields.system_generators.SystemGenerator`
signature. See the `OpenMMForceField SystemGenerator documentation`_
for more details.
Expand Down Expand Up @@ -82,7 +95,7 @@ class OpenMMSystemGeneratorFFSettings(BaseForceFieldSettings):
small_molecule_forcefield: str = "openff-2.0.0" # other default ideas 'openff-2.0.0', 'gaff-2.11', 'espaloma-0.2.0'
"""Name of the force field to be used for :class:`SmallMoleculeComponent` """

@pydantic.validator('constraints')
@validator('constraints')
def constraint_check(cls, v):
allowed = {'hbonds', 'hangles', 'allbonds'}

Expand Down

0 comments on commit 9146ea8

Please sign in to comment.