From a7f79945e202e673bfb1a98dd123287022629b80 Mon Sep 17 00:00:00 2001 From: Pascal Merz Date: Wed, 22 Jun 2022 08:39:09 +0200 Subject: [PATCH] Sync series and dataframe when subsampling Make sure that both the subsampling series and the dataframe are sliced when calling statistical_inefficieny(). This ensure that the series and the dataframe are in sync before the subsampled indices of the series are applied to the dataframe. Fixes #198 --- src/alchemlyb/preprocessing/subsampling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/alchemlyb/preprocessing/subsampling.py b/src/alchemlyb/preprocessing/subsampling.py index 3930b075..824ad8a1 100644 --- a/src/alchemlyb/preprocessing/subsampling.py +++ b/src/alchemlyb/preprocessing/subsampling.py @@ -295,6 +295,7 @@ def statistical_inefficiency(df, series=None, lower=None, upper=None, step=None, raise ValueError("series and data must be sampled at the same times") series = slicing(series, lower=lower, upper=upper, step=step) + df = slicing(df, lower=lower, upper=upper, step=step) # calculate statistical inefficiency of series (could use fft=True but needs test) statinef = statisticalInefficiency(series, fast=False)