Skip to content

Commit

Permalink
Solve FutureWarning from pandas 1.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Aug 17, 2022
1 parent bb5a7d9 commit 19930a6
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions pyscal/pyscallist.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ def df(self) -> pd.DataFrame:
assert isinstance(wateroilgas, WaterOilGas)
assert wateroilgas.wateroil is not None
assert wateroilgas.gasoil is not None
wateroil_cols = set(wateroilgas.wateroil.table.columns).intersection(
wateroil_pyscal_cols
wateroil_cols = list(
set(wateroilgas.wateroil.table.columns).intersection(
wateroil_pyscal_cols
)
)
gasoil_cols = set(wateroilgas.gasoil.table.columns).intersection(
gasoil_pyscal_cols
gasoil_cols = list(
set(wateroilgas.gasoil.table.columns).intersection(
gasoil_pyscal_cols
)
)
df_list.append(
wateroilgas.gasoil.table[gasoil_cols]
Expand All @@ -134,11 +138,15 @@ def df(self) -> pd.DataFrame:
assert scalrec.base.gasoil is not None
assert scalrec.high.wateroil is not None
assert scalrec.high.gasoil is not None
gasoil_cols = set(scalrec.base.gasoil.table.columns).intersection(
gasoil_pyscal_cols
gasoil_cols = list(
set(scalrec.base.gasoil.table.columns).intersection(
gasoil_pyscal_cols
)
)
wateroil_cols = set(scalrec.base.wateroil.table.columns).intersection(
wateroil_pyscal_cols
wateroil_cols = list(
set(scalrec.base.wateroil.table.columns).intersection(
wateroil_pyscal_cols
)
)
df_list.append(
scalrec.low.gasoil.table[gasoil_cols]
Expand Down Expand Up @@ -175,8 +183,8 @@ def df(self) -> pd.DataFrame:
for (satnum, wateroil) in enumerate(self.pyscal_list):
assert isinstance(wateroil, WaterOil)
assert wateroil is not None
wateroil_cols = set(wateroil.table.columns).intersection(
wateroil_pyscal_cols
wateroil_cols = list(
set(wateroil.table.columns).intersection(wateroil_pyscal_cols)
)
df_list.append(
wateroil.table[wateroil_cols]
Expand All @@ -187,7 +195,9 @@ def df(self) -> pd.DataFrame:
for (satnum, gasoil) in enumerate(self.pyscal_list):
assert isinstance(gasoil, GasOil)
assert gasoil is not None
gasoil_cols = set(gasoil.table.columns).intersection(gasoil_pyscal_cols)
gasoil_cols = list(
set(gasoil.table.columns).intersection(gasoil_pyscal_cols)
)
df_list.append(
gasoil.table[gasoil_cols]
.assign(SATNUM=satnum + 1)
Expand Down

0 comments on commit 19930a6

Please sign in to comment.