Skip to content

Commit

Permalink
bug fix for residence time
Browse files Browse the repository at this point in the history
  • Loading branch information
orionarcher committed Jan 13, 2023
1 parent 05cee19 commit 3dea8a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions solvation_analysis/residence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3dea8a3

Please sign in to comment.