mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 14:14:22 +08:00
Merge branch 'main' into feat/warehouse
This commit is contained in:
@@ -9,8 +9,8 @@ v1.9.1
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Fixed a bug in Protocol termination for the HybridTop and AFE Protocols
|
||||
which would unnecessarily declare an ``UnboundLocalError``.
|
||||
* Fixed a bug in Protocol termination for the HybridTop and AFE Protocols which would unnecessarily declare an ``UnboundLocalError``.
|
||||
* Updated ``openfe_analysis`` dependency to fix issue with RMSD analysis (`Issue 1834 <https://github.com/OpenFreeEnergy/openfe/issues/1834>`).
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ dependencies:
|
||||
- lomap2>=3.2.1
|
||||
- networkx
|
||||
- numpy
|
||||
- openfe-analysis>=0.3.1
|
||||
- openff-interchange-base
|
||||
- openfe-analysis>=0.4.0 # min pin https://github.com/OpenFreeEnergy/openfe/issues/1834#issuecomment-3920079481, no max to check issues with new versions
|
||||
- openff-interchange-base != 0.5.1 # https://github.com/openforcefield/openff-interchange/issues/1450
|
||||
- openff-nagl-base >=0.3.3
|
||||
- openff-nagl-models>=0.1.2
|
||||
- openff-toolkit-base >=0.16.2
|
||||
|
||||
24
news/deprecate_perses.rst
Normal file
24
news/deprecate_perses.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* Perses atom mapper and scorer functionality is deprecated, slated to be removed in ``openfe v2.0``.
|
||||
This includes ``PersesAtomMapper`` and ``default_perses_scorer``.
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
||||
@@ -6,6 +6,8 @@ The MCS class from Perses shamelessly wrapped and used here to match our API.
|
||||
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
from gufe.settings.typing import AngstromQuantity
|
||||
from openff.units import Quantity, unit
|
||||
from openff.units.openmm import to_openmm
|
||||
@@ -75,6 +77,10 @@ class PersesAtomMapper(LigandAtomMapper):
|
||||
can be mapped, default: 0.25*unit.angstrom
|
||||
|
||||
"""
|
||||
warnings.warn(
|
||||
"PersesAtomMapper is deprecated and is planned to be removed in openfe v2.0. If you have questions related to this, please open an issue at https://github.com/OpenFreeEnergy/openfe/issues.",
|
||||
DeprecationWarning,
|
||||
)
|
||||
self.allow_ring_breaking = allow_ring_breaking
|
||||
self.preserve_chirality = preserve_chirality
|
||||
self.use_positions = use_positions
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# This code is part of OpenFE and is licensed under the MIT license.
|
||||
# For details, see https://github.com/OpenFreeEnergy/openfe
|
||||
|
||||
import warnings
|
||||
from typing import Callable
|
||||
|
||||
from openfe.utils import requires_package
|
||||
@@ -67,6 +68,11 @@ def default_perses_scorer(
|
||||
-------
|
||||
float
|
||||
"""
|
||||
warnings.warn(
|
||||
"default_perses_scorer is deprecated and is planned to be removed in openfe v2.0. If you have questions related to this, please open an issue at https://github.com/OpenFreeEnergy/openfe/issues",
|
||||
DeprecationWarning,
|
||||
)
|
||||
|
||||
score = AtomMapper(use_positions=use_positions).score_mapping(
|
||||
AtomMapping(
|
||||
old_mol=mapping.componentA.to_openff(),
|
||||
|
||||
@@ -13,7 +13,10 @@ from openfe.protocols import openmm_afe
|
||||
|
||||
@pytest.mark.integration # takes too long to be a slow test ~ 4 mins locally
|
||||
@pytest.mark.flaky(reruns=3) # pytest-rerunfailures; we can get bad minimisation
|
||||
@pytest.mark.parametrize("platform", ["CPU", "CUDA"])
|
||||
@pytest.mark.parametrize(
|
||||
"platform",
|
||||
[pytest.param("CPU", marks=pytest.mark.xfail(reason="see openfe issue #1670")), "CUDA"],
|
||||
)
|
||||
def test_openmm_run_engine(
|
||||
platform,
|
||||
get_available_openmm_platforms,
|
||||
|
||||
@@ -13,8 +13,8 @@ def test_simple(atom_mapping_basic_test_files):
|
||||
# basic sanity check on the LigandAtomMapper
|
||||
mol1 = atom_mapping_basic_test_files["methylcyclohexane"]
|
||||
mol2 = atom_mapping_basic_test_files["toluene"]
|
||||
|
||||
mapper = PersesAtomMapper()
|
||||
with pytest.warns(DeprecationWarning, match="PersesAtomMapper"):
|
||||
mapper = PersesAtomMapper()
|
||||
|
||||
mapping_gen = mapper.suggest_mappings(mol1, mol2)
|
||||
|
||||
@@ -31,8 +31,8 @@ def test_generator_length(atom_mapping_basic_test_files):
|
||||
# generator stops correctly
|
||||
mol1 = atom_mapping_basic_test_files["methylcyclohexane"]
|
||||
mol2 = atom_mapping_basic_test_files["toluene"]
|
||||
|
||||
mapper = PersesAtomMapper()
|
||||
with pytest.warns(DeprecationWarning, match="PersesAtomMapper"):
|
||||
mapper = PersesAtomMapper()
|
||||
|
||||
mapping_gen = mapper.suggest_mappings(mol1, mol2)
|
||||
|
||||
@@ -45,7 +45,8 @@ def test_generator_length(atom_mapping_basic_test_files):
|
||||
@skip_if_missing("perses")
|
||||
def test_empty_atommappings(mol_pair_to_shock_perses_mapper):
|
||||
mol1, mol2 = mol_pair_to_shock_perses_mapper
|
||||
mapper = PersesAtomMapper()
|
||||
with pytest.warns(DeprecationWarning, match="PersesAtomMapper"):
|
||||
mapper = PersesAtomMapper()
|
||||
|
||||
mapping_gen = mapper.suggest_mappings(mol1, mol2)
|
||||
|
||||
@@ -59,11 +60,12 @@ def test_empty_atommappings(mol_pair_to_shock_perses_mapper):
|
||||
@skip_if_missing("openeye")
|
||||
@skip_if_missing("perses")
|
||||
def test_dict_round_trip():
|
||||
# use some none defaults
|
||||
mapper1 = PersesAtomMapper(
|
||||
allow_ring_breaking=False,
|
||||
preserve_chirality=False,
|
||||
coordinate_tolerance=0.01 * unit.nanometer,
|
||||
)
|
||||
mapper2 = PersesAtomMapper.from_dict(mapper1.to_dict())
|
||||
with pytest.warns(DeprecationWarning, match="PersesAtomMapper"):
|
||||
# use some none defaults
|
||||
mapper1 = PersesAtomMapper(
|
||||
allow_ring_breaking=False,
|
||||
preserve_chirality=False,
|
||||
coordinate_tolerance=0.01 * unit.nanometer,
|
||||
)
|
||||
mapper2 = PersesAtomMapper.from_dict(mapper1.to_dict())
|
||||
assert mapper2.to_dict() == mapper1.to_dict()
|
||||
|
||||
@@ -18,7 +18,8 @@ USING_OLD_OFF = False
|
||||
@pytest.mark.xfail(not USING_OLD_OFF, reason="perses #1108")
|
||||
def test_perses_normalization_not_using_positions(gufe_atom_mapping_matrix):
|
||||
# now run the openfe equivalent with the same ligand atom _mappings
|
||||
scorer = perses_scorers.default_perses_scorer
|
||||
with pytest.warns(DeprecationWarning, match="default_perses_scorer"):
|
||||
scorer = perses_scorers.default_perses_scorer
|
||||
molecule_row = np.max(list(gufe_atom_mapping_matrix.keys())) + 1
|
||||
norm_scores = np.zeros([molecule_row, molecule_row])
|
||||
|
||||
@@ -41,7 +42,8 @@ def test_perses_normalization_not_using_positions(gufe_atom_mapping_matrix):
|
||||
@skip_if_missing("perses")
|
||||
@pytest.mark.xfail(not USING_OLD_OFF, reason="perses #1108")
|
||||
def test_perses_not_implemented_position_using(gufe_atom_mapping_matrix):
|
||||
scorer = perses_scorers.default_perses_scorer
|
||||
with pytest.warns(DeprecationWarning, match="default_perses_scorer"):
|
||||
scorer = perses_scorers.default_perses_scorer
|
||||
|
||||
first_key = list(gufe_atom_mapping_matrix.keys())[0]
|
||||
match_re = "normalizing using positions is not currently implemented"
|
||||
@@ -76,7 +78,8 @@ def test_perses_regression(gufe_atom_mapping_matrix):
|
||||
assert matrix.shape == (8, 8)
|
||||
|
||||
# now run the openfe equivalent with the same ligand atom _mappings
|
||||
scorer = perses_scorers.default_perses_scorer
|
||||
with pytest.warns(DeprecationWarning, match="default_perses_scorer"):
|
||||
scorer = perses_scorers.default_perses_scorer
|
||||
scores = np.zeros_like(matrix)
|
||||
for (i, j), ligand_atom_mapping in gufe_atom_mapping_matrix.items():
|
||||
score = scorer(
|
||||
|
||||
Reference in New Issue
Block a user