Skip to content

Commit

Permalink
Merge pull request #512 from Lnaden/statsfix
Browse files Browse the repository at this point in the history
Fix a small bug in the timeseries test, test against min and max versions
  • Loading branch information
Lnaden authored Aug 11, 2023
2 parents 9ddeab4 + 6c8fe60 commit 7b4f89f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.8, 3.9]
python-version: [3.8, 3.11] # Check against oldest and newest versions
jax: ["", "_jax"]
exclude: # Skip win + jax
- jax: "_jax"
Expand Down
7 changes: 6 additions & 1 deletion pymbar/tests/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ def test_compare_detectEquil(show_hist=False):
bs_de = timeseries.detect_equilibration_binary_search(D_t, bs_nodes=10)
std_de = timeseries.detect_equilibration(D_t, fast=False, nskip=1)
t_res.append(bs_de[0] - std_de[0])
t_res_mode = float(stats.mode(t_res)[0][0])
try:
# scipy<1.9
t_res_mode = float(stats.mode(t_res)[0][0])
except IndexError:
# scipy>=1.9
t_res_mode = float(stats.mode(t_res, keepdims=True)[0][0])
assert_almost_equal(t_res_mode, 0.0, decimal=1)
if show_hist:
import matplotlib.pyplot as plt
Expand Down

0 comments on commit 7b4f89f

Please sign in to comment.