Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #284 #285

Merged
merged 9 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
8 changes: 8 additions & 0 deletions src/alchemlyb/estimators/mbar_.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from warnings import warn

import pandas as pd
import pymbar
Expand Down Expand Up @@ -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__(
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/alchemlyb/tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
filterwarnings =
ignore:From version 2.0.0, this will be replaced by the default alchemlyb.estimators.MBAR.:DeprecationWarning:
4 changes: 4 additions & 0 deletions src/alchemlyb/tests/test_fep_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down