Skip to content

Commit

Permalink
Resolve pandas depreication warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclark5 committed Sep 13, 2024
1 parent 4c736f6 commit e1d6e87
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/alchemlyb/parsing/lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,23 +453,20 @@ def extract_u_nk_from_u_n(
lr = tmp_df.shape[0]

Check warning on line 453 in src/alchemlyb/parsing/lammps.py

View check run for this annotation

Codecov / codecov/patch

src/alchemlyb/parsing/lammps.py#L453

Added line #L453 was not covered by tests
for lambda12 in lambda_values:
if u_nk[u_nk[lambda1_col] == lambda1].shape[0] == 0:
u_nk = pd.concat(
tmp_u_nk = pd.concat(

Check warning on line 456 in src/alchemlyb/parsing/lammps.py

View check run for this annotation

Codecov / codecov/patch

src/alchemlyb/parsing/lammps.py#L456

Added line #L456 was not covered by tests
[
u_nk,
pd.concat(
[
tmp_df[["time", "fep-lambda"]],
pd.DataFrame(
np.zeros((lr, lc)),
columns=lambda_values,
),
],
axis=1,
tmp_df[["time", "fep-lambda"]],
pd.DataFrame(
np.zeros((lr, lc)),
columns=lambda_values,
),
],
axis=0,
sort=False,
axis=1,
)
if u_nk.shape[0] == 0:
u_nk = tmp_u_nk

Check warning on line 467 in src/alchemlyb/parsing/lammps.py

View check run for this annotation

Codecov / codecov/patch

src/alchemlyb/parsing/lammps.py#L467

Added line #L467 was not covered by tests
else:
u_nk = pd.concat( [u_nk, tmp_u_nk], axis=0, sort=False)

Check warning on line 469 in src/alchemlyb/parsing/lammps.py

View check run for this annotation

Codecov / codecov/patch

src/alchemlyb/parsing/lammps.py#L469

Added line #L469 was not covered by tests

if u_nk.loc[u_nk[lambda1_col] == lambda1, lambda12][0] != 0:
raise ValueError(

Check warning on line 472 in src/alchemlyb/parsing/lammps.py

View check run for this annotation

Codecov / codecov/patch

src/alchemlyb/parsing/lammps.py#L472

Added line #L472 was not covered by tests
Expand Down

0 comments on commit e1d6e87

Please sign in to comment.