Skip to content

Commit

Permalink
Merge branch 'main' into start_septop
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahbaumann committed Jan 23, 2025
2 parents 46465fb + e39cdd3 commit c54c113
Show file tree
Hide file tree
Showing 18 changed files with 3,009 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openfe/protocols/openmm_rfe/equil_rfe_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def run(self, *, dry=False, verbose=True,
# Extract relevant settings
protocol_settings: RelativeHybridTopologyProtocolSettings = self._inputs['protocol'].settings
stateA = self._inputs['stateA']
stateB = self._inputs['stateB']
stateB = self._inputs['stateB'] # TODO: open an issue about this not being used.
mapping = self._inputs['ligandmapping']

forcefield_settings: settings.OpenMMSystemGeneratorFFSettings = protocol_settings.forcefield_settings
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions openfe/protocols/restraint_utils/geometry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .base import BaseRestraintGeometry
from .harmonic import DistanceRestraintGeometry
from .flatbottom import FlatBottomDistanceGeometry
from .boresch import BoreschRestraintGeometry
48 changes: 48 additions & 0 deletions openfe/protocols/restraint_utils/geometry/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""
Restraint Geometry classes
TODO
----
* Add relevant duecredit entries.
"""
import abc
from pydantic.v1 import BaseModel, validator


class BaseRestraintGeometry(BaseModel, abc.ABC):
"""
A base class for a restraint geometry.
"""
class Config:
arbitrary_types_allowed = True


class HostGuestRestraintGeometry(BaseRestraintGeometry):
"""
An ordered list of guest atoms to restrain.
Note
----
The order matters! It will be used to define the underlying
force.
"""

guest_atoms: list[int]
"""
An ordered list of host atoms to restrain.
Note
----
The order matters! It will be used to define the underlying
force.
"""
host_atoms: list[int]

@validator("guest_atoms", "host_atoms")
def positive_idxs(cls, v):
if v is not None and any([i < 0 for i in v]):
errmsg = "negative indices passed"
raise ValueError(errmsg)
return v
Loading

0 comments on commit c54c113

Please sign in to comment.