Skip to content

Commit

Permalink
Merge branch 'main' into reports-subpackage
Browse files Browse the repository at this point in the history
  • Loading branch information
craabreu committed Apr 10, 2024
2 parents 3eb2922 + 3aebba9 commit 826eb70
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cvpack/openmm_force_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,22 @@ def __init__( # pylint: disable=super-init-not-called
if isinstance(openmmForce, openmm.Force):
openmmForce = openmm.XmlSerializer.serialize(openmmForce)
unit = Unit(unit)
self.this = openmm.XmlSerializer.deserialize(openmmForce).this
self._wrapped_force = openmm.XmlSerializer.deserialize(openmmForce)
self.this = self._wrapped_force.this
self._registerCV(name, unit, openmmForce, unit, periodicBounds)
if periodicBounds is not None:
self._registerPeriodicBounds(*periodicBounds)

def __getattr__(self, name: str) -> t.Any:
attr = getattr(self._wrapped_force, name)
if callable(attr):

def _wrapped_method(*args, **kwargs):
return attr(*args, **kwargs)

return _wrapped_method

return attr


OpenMMForceWrapper.registerTag("!cvpack.OpenMMForceWrapper")

0 comments on commit 826eb70

Please sign in to comment.