Skip to content

Commit

Permalink
Merge pull request #257 from OpenBioSim/backport_254
Browse files Browse the repository at this point in the history
Backport fixes from PR #254
  • Loading branch information
lohedges authored Oct 30, 2024
2 parents 52a0578 + 5377676 commit d6733c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.
* Please add an item to this CHANGELOG for any new features or bug fixes when creating a PR.
* Fixed instantiaton of ``QByteArray`` in ``Sire::Mol::Frame::toByteArray`` and count bytes with ``QByteArray::size``.
* Increase timeout before terminating ``QThread`` objects during ``PageCache`` cleanup.
* Expose missing ``timeout`` kwarg in :meth:`dynamics.minimise()` method.
* Expose missing ``include_constrained_energies`` kwarg in minimisation function.
* Make minimisation function settings consistent across API.

`2024.3.0 <https://github.com/openbiosim/sire/compare/2024.2.0...2024.3.0>`__ - October 2024
--------------------------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions src/sire/mol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@ def _minimisation(
if platform is not None:
map.set("platform", str(platform))

if include_constrained_energies is not None:
map.set("include_constrained_energies", include_constrained_energies)

return Minimisation(
view,
cutoff=cutoff,
Expand Down
12 changes: 8 additions & 4 deletions src/sire/mol/_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,8 @@ def run_minimisation(
max_restarts: int = 10,
max_ratchets: int = 20,
ratchet_frequency: int = 500,
starting_k: float = 100.0,
ratchet_scale: float = 2.0,
starting_k: float = 400.0,
ratchet_scale: float = 10.0,
max_constraint_error: float = 0.001,
timeout: str = "300s",
):
Expand Down Expand Up @@ -1254,9 +1254,10 @@ def minimise(
max_restarts: int = 10,
max_ratchets: int = 20,
ratchet_frequency: int = 500,
starting_k: float = 100.0,
ratchet_scale: float = 2.0,
starting_k: float = 400.0,
ratchet_scale: float = 10.0,
max_constraint_error: float = 0.001,
timeout: str = "300s",
):
"""
Internal method that runs minimisation on the molecules.
Expand Down Expand Up @@ -1290,6 +1291,8 @@ def minimise(
- starting_k (float): The starting value of k for the minimisation
- ratchet_scale (float): The amount to scale k at each ratchet
- max_constraint_error (float): The maximum error in the constraints in nm
- timeout (float): The maximum time to run the minimisation for in seconds.
A value of <=0 will disable the timeout.
"""
if not self._d.is_null():
self._d.run_minimisation(
Expand All @@ -1301,6 +1304,7 @@ def minimise(
starting_k=starting_k,
ratchet_scale=ratchet_scale,
max_constraint_error=max_constraint_error,
timeout=timeout,
)

return self
Expand Down

0 comments on commit d6733c0

Please sign in to comment.