Skip to content

Commit 9b46988

Browse files
pymbar4 (#268)
* fix #207 * switch from pymbar 3 to pymbar 4 (minimal requirement pymbar>=4) * remove deprecated AutoMBAR * change estimators.MBAR kwarg method from "hybr" to "robust" * docs: note pymbar 4.x for 2.0 * update tests * Update CHANGES Co-authored-by: Oliver Beckstein <orbeckst@gmail.com>
1 parent 3bbbef2 commit 9b46988

File tree

15 files changed

+115
-263
lines changed

15 files changed

+115
-263
lines changed

CHANGES

+11-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,24 @@ The rules for this file:
1313
* release numbers follow "Semantic Versioning" https://semver.org
1414

1515
------------------------------------------------------------------------------
16-
1716
*/*/* xiki-tempula, orbeckst
1817

1918
* 2.0.0
2019

20+
Changes
21+
- use pymbar 4 as backend; this release is incompatible with
22+
pymbar 3.x (issue #207, PR #268, discussion #205).
23+
- The default for keyword argument `method` in estimators.MBAR was changed
24+
from "hybr" to "robust" (issue #207, PR #268).
25+
2126
Enhancements
22-
- Add a new Error when no file has been matched in workflow.ABFE (PR #289).
27+
- Raise ValueError when no file has been matched in workflow.ABFE (PR #289).
2328
- In workflows, the output folder will be created if it did not exist before
2429
(PR #290).
30+
31+
Removals
32+
- The AutoMBAR estimator was removed because pymbar 4's MBAR contains
33+
equivalent functionality. (issue #284)
2534

2635

2736
12/09/2022 DrDomenicoMarson, xiki-tempula, orbeckst

devtools/conda-envs/test_env.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python
66
- numpy
77
- pandas
8-
- pymbar >=3.0.5,<4
8+
- pymbar>=4
99
- scipy
1010
- scikit-learn
1111
- matplotlib

docs/index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ These functions are simple in usage and pure in scope, and can be chained togeth
1414

1515
**alchemlyb** seeks to be as boring and simple as possible to enable more complex work. Its components allow work at all scales, from use on small systems using a single workstation to larger datasets that require distributed computing using libraries such as `dask`_.
1616

17-
The library is *under active development*. However, it is used by multiple groups in a production environment. We use `semantic versioning`_ to indicate clearly what kind of changes you may expect between releases. With release 1.0.0, the API has stabilized and is guaranteed to remain backwards-compatible until a 2.0.0 release.
17+
The library is *under active development*. However, it is used by multiple groups in a production environment. We use `semantic versioning`_ to indicate clearly what kind of changes you may expect between releases. Within any major release (1.x, 2.x, ...), the API is stable and is guaranteed to remain backwards-compatible.
1818

1919
.. Note::
20-
The current 1.x release of alchemlyb *only* supports `pymbar`_ releases **>= 3.0.5, <4.0**.
21-
A future 2.x release of alchemlyb will *only* support pymbar **>= 4.0** (see `discussion #205`_ and `issue #207`_)
20+
The **current 2.x release** of alchemlyb *only* supports `pymbar`_ releases **>= 4.0**.
21+
(Previous 1.x releases only support pymbar >= 3.0.5, <4.) See `discussion #205`_ and `issue #207`_.
2222

2323
See :ref:`contact` for how to get in touch if you have questions or find problems.
2424

environment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: alchemlyb
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.8
5+
- python
66
- numpy
77
- pandas
8-
- pymbar >=3.0.5,<4
8+
- pymbar>=4
99
- scipy
1010
- scikit-learn
1111
- matplotlib

setup.py

+43-36
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,46 @@
1111

1212
import versioneer
1313

14-
setup(name='alchemlyb',
15-
version=versioneer.get_version(),
16-
cmdclass=versioneer.get_cmdclass(),
17-
description='the simple alchemistry library',
18-
author='David Dotson',
19-
author_email='dotsdl@gmail.com',
20-
maintainer='Oliver Beckstein',
21-
maintainer_email='orbeckst@gmail.com',
22-
classifiers=[
23-
'Development Status :: 5 - Production/Stable',
24-
'Intended Audience :: Science/Research',
25-
'License :: OSI Approved :: BSD License',
26-
'Operating System :: POSIX',
27-
'Operating System :: MacOS :: MacOS X',
28-
'Operating System :: Microsoft :: Windows ',
29-
'Programming Language :: Python',
30-
'Programming Language :: Python :: 3',
31-
'Programming Language :: Python :: 3.8',
32-
'Programming Language :: Python :: 3.9',
33-
'Programming Language :: Python :: 3.10',
34-
'Programming Language :: Python :: 3.11',
35-
'Topic :: Scientific/Engineering',
36-
'Topic :: Scientific/Engineering :: Bio-Informatics',
37-
'Topic :: Scientific/Engineering :: Chemistry',
38-
'Topic :: Software Development :: Libraries :: Python Modules',
39-
],
40-
packages=find_packages('src'),
41-
package_dir={'': 'src'},
42-
license='BSD',
43-
long_description=open('README.rst').read(),
44-
long_description_content_type='text/x-rst',
45-
python_requires='>=3.8',
46-
tests_require = ['pytest', 'alchemtest'],
47-
install_requires=['numpy', 'pandas>=1.4', 'pymbar>=3.0.5,<4',
48-
'scipy', 'scikit-learn', 'matplotlib']
49-
)
14+
setup(
15+
name="alchemlyb",
16+
version=versioneer.get_version(),
17+
cmdclass=versioneer.get_cmdclass(),
18+
description="the simple alchemistry library",
19+
author="David Dotson",
20+
author_email="dotsdl@gmail.com",
21+
maintainer="Oliver Beckstein",
22+
maintainer_email="orbeckst@gmail.com",
23+
classifiers=[
24+
"Development Status :: 5 - Production/Stable",
25+
"Intended Audience :: Science/Research",
26+
"License :: OSI Approved :: BSD License",
27+
"Operating System :: POSIX",
28+
"Operating System :: MacOS :: MacOS X",
29+
"Operating System :: Microsoft :: Windows ",
30+
"Programming Language :: Python",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Topic :: Scientific/Engineering",
37+
"Topic :: Scientific/Engineering :: Bio-Informatics",
38+
"Topic :: Scientific/Engineering :: Chemistry",
39+
"Topic :: Software Development :: Libraries :: Python Modules",
40+
],
41+
packages=find_packages("src"),
42+
package_dir={"": "src"},
43+
license="BSD",
44+
long_description=open("README.rst").read(),
45+
long_description_content_type="text/x-rst",
46+
python_requires=">=3.8",
47+
tests_require=["pytest", "alchemtest"],
48+
install_requires=[
49+
"numpy",
50+
"pandas>=1.4",
51+
"pymbar>=4",
52+
"scipy",
53+
"scikit-learn",
54+
"matplotlib",
55+
],
56+
)

src/alchemlyb/convergence/convergence.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import pandas as pd
88

99
from .. import concat
10-
from ..estimators import AutoMBAR as MBAR
11-
from ..estimators import BAR, TI, FEP_ESTIMATORS, TI_ESTIMATORS
10+
from ..estimators import BAR, TI, MBAR, FEP_ESTIMATORS, TI_ESTIMATORS
1211
from ..postprocessors.units import to_kT
1312

1413
estimators_dispatch = {"BAR": BAR, "TI": TI, "MBAR": MBAR}
@@ -57,19 +56,13 @@ def forward_backward_convergence(df_list, estimator="MBAR", num=10, **kwargs):
5756
9 3.044149 0.016405 3.044385 0.016402 1.0
5857
5958
60-
Note
61-
-----
62-
:class:`~alchemlyb.estimators.AutoMBAR` is used when ``estimator='MBAR'``,
63-
supply ``method`` keyword to restore the behavior of
64-
:class:`~alchemlyb.estimators.MBAR`.
65-
(:code:`forward_backward_convergence(u_nk, 'MBAR', num=2, method='adaptive')`)
66-
67-
6859
.. versionadded:: 0.6.0
6960
.. versionchanged:: 1.0.0
7061
The ``estimator`` accepts uppercase input.
7162
The default for using ``estimator='MBAR'`` was changed from
7263
:class:`~alchemlyb.estimators.MBAR` to :class:`~alchemlyb.estimators.AutoMBAR`.
64+
.. versionchanged:: 2.0.0
65+
Use pymbar.MBAR instead of the AutoMBAR option.
7366
7467
"""
7568
logger = logging.getLogger("alchemlyb.convergence." "forward_backward_convergence")

src/alchemlyb/estimators/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .bar_ import BAR
2-
from .mbar_ import MBAR, AutoMBAR
2+
from .mbar_ import MBAR
33
from .ti_ import TI
44

5-
FEP_ESTIMATORS = [MBAR.__name__, AutoMBAR.__name__, BAR.__name__]
5+
FEP_ESTIMATORS = [MBAR.__name__, BAR.__name__]
66
TI_ESTIMATORS = [TI.__name__]

src/alchemlyb/estimators/bar_.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22
import pandas as pd
3-
from pymbar import BAR as BAR_
3+
from pymbar.other_estimators import bar as BAR_
44
from sklearn.base import BaseEstimator
55

66
from .base import _EstimatorMixOut
@@ -113,7 +113,7 @@ def fit(self, u_nk):
113113
w_r = uk1.iloc[:, k] - uk1.iloc[:, k + 1]
114114

115115
# now determine df and ddf using pymbar.BAR
116-
df, ddf = BAR_(
116+
out = BAR_(
117117
w_f,
118118
w_r,
119119
method=self.method,
@@ -122,6 +122,7 @@ def fit(self, u_nk):
122122
verbose=self.verbose,
123123
)
124124

125+
df, ddf = out["Delta_f"], out["dDelta_f"]
125126
deltas = np.append(deltas, df)
126127
d_deltas = np.append(d_deltas, ddf**2)
127128

0 commit comments

Comments
 (0)