Skip to content

Commit

Permalink
Resolve FutureWarnigns from pandas 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Nov 16, 2022
1 parent 02ab2da commit 281a1f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyscal/utils/monotonicity.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def modify_dframe_monotonicity(
# Prepare and check columns:
for col in monotonicity:
if dframe[col].dtype != np.float64:
dframe.loc[:, col] = dframe[col].astype(float)
dframe[col] = dframe[col].astype(float)

# Bail on clearly erroneous data:
check_almost_monotone(dframe[col], digits, monotonicity[col]["sign"])
Expand Down
10 changes: 5 additions & 5 deletions pyscal/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ def check_table(dframe: pd.DataFrame) -> None:
if "SW" in dframe and "SG" not in dframe:
# (avoiding GasWater tables, where sw is an auxiliary column)
assert len(dframe["SW"].unique()) == len(dframe)
assert dframe["SW"].is_monotonic
assert dframe["SW"].is_monotonic_increasing
assert (dframe["SW"] >= 0.0).all()
assert dframe["SWN"].is_monotonic
assert dframe["SWN"].is_monotonic_increasing
assert dframe["SON"].is_monotonic_decreasing
assert dframe["SWNPC"].is_monotonic
assert dframe["SWNPC"].is_monotonic_increasing
if "SG" in dframe:
assert len(dframe["SG"].unique()) == len(dframe)
assert dframe["SG"].is_monotonic
assert dframe["SG"].is_monotonic_increasing
assert (dframe["SG"] >= 0.0).all()
assert dframe["SGN"].is_monotonic
assert dframe["SGN"].is_monotonic_increasing
assert dframe["SON"].is_monotonic_decreasing
if "KROW" in dframe:
assert series_decreasing(dframe["KROW"])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_slgof.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def check_table(dframe):
"""Check sanity of important columns"""
assert not dframe.empty
assert not dframe.isnull().values.any()
assert dframe["SL"].is_monotonic
assert dframe["SL"].is_monotonic_increasing
assert (dframe["SL"] >= 0.0).all()
assert (dframe["SL"] <= 1.0).all()
# Increasing, but not monotonically for slgof
Expand Down

0 comments on commit 281a1f3

Please sign in to comment.