diff --git a/docs/make_plots.py b/docs/make_plots.py index d6084e45..9e552559 100644 --- a/docs/make_plots.py +++ b/docs/make_plots.py @@ -1,4 +1,5 @@ """Generates plots for usage in documentation""" + from pathlib import Path import matplotlib.pyplot as plt diff --git a/src/pyscal/constants.py b/src/pyscal/constants.py index c635ec51..2ca20a66 100644 --- a/src/pyscal/constants.py +++ b/src/pyscal/constants.py @@ -1,20 +1,21 @@ """Constants used for pyscal modules: - * ``SWINTEGERS``: Number of different Sw values within [0,1] we allow - This is used to create integer indices of Sw, since Floating Point - indices are flaky in Pandas (and in general on computers) +* ``SWINTEGERS``: Number of different Sw values within [0,1] we allow + This is used to create integer indices of Sw, since Floating Point + indices are flaky in Pandas (and in general on computers) - * ``EPSILON``: Used as "a small number" for ensuring no floating point - comparisons/errors pop up. You cannot have the h parameter less - than this when generating relperm tables +* ``EPSILON``: Used as "a small number" for ensuring no floating point + comparisons/errors pop up. You cannot have the h parameter less + than this when generating relperm tables - * ``MAX_EXPONENT_KR``: Maximal number for exponents in relperm parameterizations. - Used to avoid numerical instabilities. It could probably be much - higher than the chosen number in most circumstances, but such high - numbers should not be relevant for relative permeability +* ``MAX_EXPONENT_KR``: Maximal number for exponents in relperm parameterizations. + Used to avoid numerical instabilities. It could probably be much + higher than the chosen number in most circumstances, but such high + numbers should not be relevant for relative permeability - * ``MAX_EXPONENT_PC``: Maximal number for exponents in cap pressure parameterizations. +* ``MAX_EXPONENT_PC``: Maximal number for exponents in cap pressure parameterizations. """ + SWINTEGERS: int = 10000 EPSILON: float = 1e-08 diff --git a/src/pyscal/gasoil.py b/src/pyscal/gasoil.py index 13711be5..358c4a46 100644 --- a/src/pyscal/gasoil.py +++ b/src/pyscal/gasoil.py @@ -404,9 +404,9 @@ def set_endpoints_linearpart_krg( self.table["SG"] >= (1 - (self.sorg + self.swl + epsilon)), "KRG" ] = tmp.loc[tmp["SG"] >= (1 - (self.sorg + self.swl + epsilon)), "KRG"] else: - self.table.loc[ - self.table["SG"] > (1 - (self.swl + epsilon)), "KRG" - ] = krgend + self.table.loc[self.table["SG"] > (1 - (self.swl + epsilon)), "KRG"] = ( + krgend + ) if krgmax and krgmax < 1.0 and self.sorg > 0: # Only warn if something else than default is in use logger.warning("krgmax ignored when not anchoring to sorg") diff --git a/src/pyscal/wateroil.py b/src/pyscal/wateroil.py index 8f78b810..2033c99b 100644 --- a/src/pyscal/wateroil.py +++ b/src/pyscal/wateroil.py @@ -342,10 +342,10 @@ def add_fromtable( dframe[linearpart][swcolname].astype(float), dframe[linearpart][krwcolname].astype(float), ) - self.table.loc[ - self.table["SW"] >= 1 - sorw, "KRW" - ] = linearinterpolator( - self.table.loc[self.table["SW"] >= 1 - sorw, "SW"] + self.table.loc[self.table["SW"] >= 1 - sorw, "KRW"] = ( + linearinterpolator( + self.table.loc[self.table["SW"] >= 1 - sorw, "SW"] + ) ) self.table["KRW"] = self.table["KRW"].clip(lower=0.0, upper=1.0) self.sorw = sorw @@ -393,10 +393,10 @@ def add_fromtable( dframe.loc[linearpart, swcolname].astype(float), dframe.loc[linearpart, krowcolname].astype(float), ) - self.table.loc[ - self.table["SW"] >= 1 - socr, "KROW" - ] = linearinterpolator( - self.table.loc[self.table["SW"] >= 1 - socr, "SW"] + self.table.loc[self.table["SW"] >= 1 - socr, "KROW"] = ( + linearinterpolator( + self.table.loc[self.table["SW"] >= 1 - socr, "SW"] + ) ) self.table["KROW"] = self.table["KROW"].clip(lower=0.0, upper=1.0) self.socr = socr diff --git a/src/pyscal/wateroilgas.py b/src/pyscal/wateroilgas.py index d820a06f..f5203671 100644 --- a/src/pyscal/wateroilgas.py +++ b/src/pyscal/wateroilgas.py @@ -16,7 +16,6 @@ class WaterOilGas: - """A representation of three-phase properties for oil-water-gas Use one object for each satnum. diff --git a/tests/benchme.py b/tests/benchme.py index 748e62de..47cc4bd2 100644 --- a/tests/benchme.py +++ b/tests/benchme.py @@ -1,4 +1,5 @@ """Example code for benchmarking of the "fast" feature""" + import timeit from pyscal import WaterOilGas diff --git a/tests/test_factory.py b/tests/test_factory.py index bdc5fed8..73d2da64 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -1,4 +1,5 @@ """Test the PyscalFactory module""" + import os from pathlib import Path diff --git a/tests/test_gasoil.py b/tests/test_gasoil.py index 89f432a8..aaca8944 100644 --- a/tests/test_gasoil.py +++ b/tests/test_gasoil.py @@ -1,4 +1,5 @@ """Test module for GasOil objects""" + import io import sys diff --git a/tests/test_utils_capillarypressure.py b/tests/test_utils_capillarypressure.py index 24abdbda..99beda8b 100644 --- a/tests/test_utils_capillarypressure.py +++ b/tests/test_utils_capillarypressure.py @@ -1,4 +1,5 @@ """Test module for capillary pressure support code in pyscal""" + import math import hypothesis.strategies as st diff --git a/tests/test_utils_monotonicity.py b/tests/test_utils_monotonicity.py index 5219e6c2..5d8c1300 100644 --- a/tests/test_utils_monotonicity.py +++ b/tests/test_utils_monotonicity.py @@ -1,4 +1,5 @@ """Test module for monotonicity support functions in pyscal""" + import os import numpy as np diff --git a/tests/test_wateroil.py b/tests/test_wateroil.py index 32fa4bfc..cec9ffa7 100644 --- a/tests/test_wateroil.py +++ b/tests/test_wateroil.py @@ -1,4 +1,5 @@ """Test module for the WaterOil object""" + import io import sys