Skip to content

Commit

Permalink
fix deprecated pandas level use (#176)
Browse files Browse the repository at this point in the history
- replace aggregrations with level with groupby(level).aggregation
  • Loading branch information
orbeckst authored Oct 30, 2021
1 parent 461a72d commit a1c0b09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Fixes
- Subsampling now works with bounds and step (PR #167, issue #166).
- AMBER parser logger now always logs to alchemlyb.parsers.Amber
instead of the root logger (PR #173)
- updated deprecated pandas aggregation, now using groupby(level).agg (#175)


09/17/2021 xiki-tempula, orbeckst
Expand Down
10 changes: 5 additions & 5 deletions src/alchemlyb/estimators/ti_.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TI(BaseEstimator):
The estimated dimensionless free energy difference between each state.
d_delta_f_ : DataFrame
The estimated statistical uncertainty (one standard deviation) in
The estimated statistical uncertainty (one standard deviation) in
dimensionless free energy differences.
states_ : list
Expand All @@ -41,7 +41,7 @@ def fit(self, dHdl):
Parameters
----------
dHdl : DataFrame
dHdl : DataFrame
dHdl[n,k] is the potential energy gradient with respect to lambda
for each configuration n and lambda k.
Expand All @@ -54,9 +54,9 @@ def fit(self, dHdl):
# obtain the mean and variance of the mean for each state
# variance calculation assumes no correlation between points
# used to calculate mean
means = dHdl.mean(level=dHdl.index.names[1:])
variances = np.square(dHdl.sem(level=dHdl.index.names[1:]))
means = dHdl.groupby(level=dHdl.index.names[1:]).mean()
variances = np.square(dHdl.groupby(level=dHdl.index.names[1:]).sem())

# get the lambda names
l_types = dHdl.index.names[1:]

Expand Down

0 comments on commit a1c0b09

Please sign in to comment.