diff --git a/CHANGES b/CHANGES index ad91f5ac..8fa61fad 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,10 @@ Fixes there are no spaces around the equal sign (issue #272, PR #273). - Pre-processing function slicing will not drop NaN rows (issue #274, PR #275). + +Deprecations + - deprecate AutoMBAR for removal in 2.0 because pymbar 4 already contains + equivalent functionality (issue #284, PR #285). Internal Enhancements (do not affect API) - Blackfy the codebase (PR #280). diff --git a/src/alchemlyb/estimators/mbar_.py b/src/alchemlyb/estimators/mbar_.py index 4759d687..001e85b9 100644 --- a/src/alchemlyb/estimators/mbar_.py +++ b/src/alchemlyb/estimators/mbar_.py @@ -1,4 +1,5 @@ import logging +from warnings import warn import pandas as pd import pymbar @@ -200,6 +201,9 @@ class AutoMBAR(MBAR): .. versionadded:: 0.6.0 .. versionchanged:: 1.0.0 AutoMBAR accepts the `method` argument. + .. deprecated:: 1.0.1 + Deprecate AutoMBAR in favour of MBAR for pymbar4. It will be removed + in alchemlyb 2.0.0. """ def __init__( @@ -210,6 +214,10 @@ def __init__( verbose=False, method=None, ): + warn( + "From version 2.0.0, this will be replaced by the default alchemlyb.estimators.MBAR.", + DeprecationWarning, + ) super().__init__( maximum_iterations=maximum_iterations, relative_tolerance=relative_tolerance, diff --git a/src/alchemlyb/tests/pytest.ini b/src/alchemlyb/tests/pytest.ini new file mode 100644 index 00000000..fa6b641f --- /dev/null +++ b/src/alchemlyb/tests/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +filterwarnings = + ignore:From version 2.0.0, this will be replaced by the default alchemlyb.estimators.MBAR.:DeprecationWarning: \ No newline at end of file diff --git a/src/alchemlyb/tests/test_fep_estimators.py b/src/alchemlyb/tests/test_fep_estimators.py index 9d041eb8..c6d8e4b7 100644 --- a/src/alchemlyb/tests/test_fep_estimators.py +++ b/src/alchemlyb/tests/test_fep_estimators.py @@ -55,6 +55,10 @@ def test_mbar(self, X_delta_f): class TestAutoMBAR(TestMBAR): cls = AutoMBAR + def test_autombar(self, X_delta_f): + with pytest.deprecated_call(): + self.compare_delta_f(X_delta_f) + class TestMBAR_fail: def test_failback_adaptive(self, gmx_ABFE_complex_n_uk):