Skip to content

Commit

Permalink
Clean future warning messages from pandas (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
alifbe authored Mar 19, 2024
1 parent ff9b018 commit 2cd0feb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/pyscal/gasoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ def add_fromtable(
)
# Do not extrapolate this data. We will bfill and ffill afterwards
self.table["KRG"] = pchip(self.table["SG"], extrapolate=False)
self.table["KRG"] = self.table["KRG"].fillna(method="ffill")
self.table["KRG"] = self.table["KRG"].fillna(method="bfill")
self.table["KRG"] = self.table["KRG"].ffill()
self.table["KRG"] = self.table["KRG"].bfill()
self.table["KRG"] = self.table["KRG"].clip(lower=0.0, upper=1.0)
self.krgcomment = "-- krg from tabular input" + krgcomment + "\n"
self.sgcr = self.estimate_sgcr()
Expand All @@ -309,8 +309,8 @@ def add_fromtable(
dframe[sgcolname].astype(float), dframe[krogcolname].astype(float)
)
self.table["KROG"] = pchip(self.table["SG"], extrapolate=False)
self.table["KROG"] = self.table["KROG"].fillna(method="ffill")
self.table["KROG"] = self.table["KROG"].fillna(method="bfill")
self.table["KROG"] = self.table["KROG"].ffill()
self.table["KROG"] = self.table["KROG"].bfill()
self.table["KROG"] = self.table["KROG"].clip(lower=0.0, upper=1.0)
self.krogcomment = "-- krog from tabular input" + krogcomment + "\n"
self.sorg = self.estimate_sorg()
Expand Down
2 changes: 1 addition & 1 deletion src/pyscal/wateroil.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ def add_skjaeveland_pc(

# From 1-sor, the pc is not defined. Extrapolate constantly, and let
# the non-monotonicity be fixed in the output generators.
self.table["PC"] = self.table["PC"].fillna(method="ffill")
self.table["PC"] = self.table["PC"].ffill()

def add_LET_pc_pd(
self,
Expand Down
4 changes: 2 additions & 2 deletions src/pyscal/wateroilgas.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ def SOF3(self, header: bool = True, dataincommentrow: bool = True) -> str:
.set_index("SO")
.sort_index()
.interpolate(method="slinear")
.fillna(method="ffill")
.fillna(method="bfill")
.ffill()
.bfill()
.reset_index()
)
sof3table["soint"] = list(map(round, sof3table["SO"] * SWINTEGERS))
Expand Down

0 comments on commit 2cd0feb

Please sign in to comment.