From 3dea8a3d690770e49aba2419661d668f3d257ca2 Mon Sep 17 00:00:00 2001 From: orioncohen Date: Thu, 12 Jan 2023 16:10:42 -0800 Subject: [PATCH] bug fix for residence time --- solvation_analysis/residence.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/solvation_analysis/residence.py b/solvation_analysis/residence.py index 9a30bcbf..708b2d00 100644 --- a/solvation_analysis/residence.py +++ b/solvation_analysis/residence.py @@ -244,9 +244,8 @@ def _calculate_auto_covariance(adjacency_matrix): for solute_ix, solute_df in adjacency_matrix.groupby([SOLUTE_IX, SOLUTE_ATOM_IX]): # this is needed to make sure auto-covariances can be concatenated later - if solute_df.index.levshape[0] != adjacency_matrix.index.levshape[0]: - solute_df = solute_df.droplevel([SOLUTE_IX, SOLUTE_ATOM_IX]).reindex(timesteps, fill_value=0) - non_zero_cols = solute_df.loc[:, (solute_df != 0).any(axis=0)] + new_solute_df = solute_df.droplevel([SOLUTE_IX, SOLUTE_ATOM_IX]).reindex(timesteps, fill_value=0) + non_zero_cols = new_solute_df.loc[:, (solute_df != 0).any(axis=0)] auto_covariance_df = non_zero_cols.apply( acovf, axis=0,