diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7f5781bc..7f8b3b64 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -29,12 +29,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: setup_miniconda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: python-version: "3.10" auto-update-conda: true @@ -55,7 +55,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ - name: publish_pypi if: github.event_name == 'release' && github.event.action == 'published' diff --git a/CHANGES b/CHANGES index 026e2cd3..11fe15a4 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,14 @@ The rules for this file: * accompany each entry with github issue/PR number (Issue #xyz) * release numbers follow "Semantic Versioning" https://semver.org +09/19/2024 orbeckst, jaclark5 + + * 2.4.1 + +Fixes + - [doc] tutorial: use alchemlyb.concat (PR #399) + - Resolve pandas FutureWarnings in bar_.py and mbar_.py (issue #408 PR #407) + 09/17/2024 jaclark5, orbeckst @@ -25,6 +33,7 @@ Enhancements Changes - modernize build system: replaced setup.py,cfg with pyproject.toml (#385) + 08/24/2024 xiki-tempula * 2.3.2 diff --git a/CITATION.cff b/CITATION.cff index f9030c7b..5105ba83 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -3,10 +3,11 @@ # Visit https://bit.ly/cffinit to generate yours today! cff-version: 1.2.0 -title: alchemlyb +title: 'alchemlyb: the simple alchemistry library' message: >- If you use this software, please cite it using the - preferred citation together with any other references. + preferred citation (JOSS DOI 10.21105/joss.06934) together + with any other references. type: software authors: - email: david@datryllic.com diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 1a044935..a60c3ba7 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -76,7 +76,7 @@ method. More estimators are available in the section on >>> import pandas as pd >>> mbar = MBAR() - >>> mbar.fit(pd.concat(decorrelated_u_nk_list)) + >>> mbar.fit(alchemlyb.concat(decorrelated_u_nk_list)) >>> mbar.delta_f_ 0.00 0.25 0.50 0.75 1.00 0.00 0.000000 1.613595 2.553407 2.983336 3.039517 @@ -152,4 +152,4 @@ also perform a set of analysis that allows the user to examine the quality of the estimation. -.. _alchemtest: https://github.com/alchemistry/alchemtest \ No newline at end of file +.. _alchemtest: https://github.com/alchemistry/alchemtest diff --git a/src/alchemlyb/estimators/bar_.py b/src/alchemlyb/estimators/bar_.py index 22bf958f..e0ce2647 100644 --- a/src/alchemlyb/estimators/bar_.py +++ b/src/alchemlyb/estimators/bar_.py @@ -97,7 +97,11 @@ def fit(self, u_nk): # group u_nk by lambda states groups = u_nk.groupby(level=u_nk.index.names[1:]) N_k = [ - (len(groups.get_group(i)) if i in groups.groups else 0) + ( + len(groups.get_group(i if isinstance(i, tuple) else (i,))) + if i in groups.groups + else 0 + ) for i in u_nk.columns ] @@ -119,12 +123,21 @@ def fit(self, u_nk): continue # get us from lambda step k - uk = groups.get_group(self._states_[k]) + uk = groups.get_group( + self._states_[k] + if isinstance(self._states_[k], tuple) + else (self._states_[k],) + ) # get w_F w_f = uk.iloc[:, k + 1] - uk.iloc[:, k] # get us from lambda step k+1 - uk1 = groups.get_group(self._states_[k + 1]) + uk1 = groups.get_group( + self._states_[k + 1] + if isinstance(self._states_[k + 1], tuple) + else (self._states_[k + 1],) + ) + # get w_R w_r = uk1.iloc[:, k] - uk1.iloc[:, k + 1] diff --git a/src/alchemlyb/estimators/mbar_.py b/src/alchemlyb/estimators/mbar_.py index ab35df14..45a648f6 100644 --- a/src/alchemlyb/estimators/mbar_.py +++ b/src/alchemlyb/estimators/mbar_.py @@ -127,7 +127,11 @@ def fit(self, u_nk): groups = u_nk.groupby(level=u_nk.index.names[1:]) N_k = [ - (len(groups.get_group(i)) if i in groups.groups else 0) + ( + len(groups.get_group(i if isinstance(i, tuple) else (i,))) + if i in groups.groups + else 0 + ) for i in u_nk.columns ] self._states_ = u_nk.columns.values.tolist()