Skip to content

Commit

Permalink
Merge branch 'master' into 71-joss-paper
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckst authored Sep 19, 2024
2 parents dd117d8 + 8a361d5 commit acac89d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
9 changes: 9 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
.. _alchemtest: https://github.com/alchemistry/alchemtest
19 changes: 16 additions & 3 deletions src/alchemlyb/estimators/bar_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand All @@ -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]

Expand Down
6 changes: 5 additions & 1 deletion src/alchemlyb/estimators/mbar_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit acac89d

Please sign in to comment.