Skip to content

Commit 7272760

Browse files
committed
Fix h_min after unintended change
SWINTEGERS was changed in 469bb84, and other critical usage of that constant has to be adjusted accordingly. There are still other places where SWINTEGERS are used, but as long as tests pass they should be fine. Also adjust the lower limit for h in test_slgof_hypo. If h can become much lower than h_min, hypothesis shrinking in case of errors becomes very slow.
1 parent d6f0bf7 commit 7272760

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/pyscal/gasoil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(
8989

9090
assert isinstance(krgendanchor, str), "krgendanchor must be a string"
9191

92-
h_min = 1.0 / float(SWINTEGERS)
92+
h_min = 10.0 / float(SWINTEGERS)
9393
if h < h_min:
9494
logger.warning(
9595
"Requested saturation step length (%g) too small, reset to %g", h, h_min

src/pyscal/wateroil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __init__(
106106

107107
self.swcomment: str = ""
108108

109-
h_min = 1.0 / float(SWINTEGERS)
109+
h_min = 10.0 / float(SWINTEGERS)
110110
if h < h_min:
111111
logger.warning(
112112
"Requested saturation step length (%g) too small, reset to %g", h, h_min

tests/test_gasoil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_gasoil_init():
7070
# Test too small h:
7171
gasoil = GasOil(swl=0.1, h=0.00000000000000000001)
7272
# (a warning is printed that h is truncated)
73-
assert gasoil.h == 1 / SWINTEGERS
73+
assert gasoil.h == 10 / SWINTEGERS
7474

7575

7676
def test_conserve_sgcr(mocker):

tests/test_slgof.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def test_numerical_problems(swl, sorg, sgcr):
125125
st.floats(min_value=0.0, max_value=0.3),
126126
st.floats(min_value=0.0, max_value=0.3),
127127
st.floats(min_value=0.0, max_value=0.3),
128-
st.floats(min_value=1.0 / float(100 * SWINTEGERS), max_value=0.5),
128+
st.floats(min_value=1.0 / SWINTEGERS, max_value=0.5),
129129
)
130130
def test_slgof_hypo(swl, sorg, sgcr, h):
131131
"""Shotgun-testing of slgof"""

0 commit comments

Comments
 (0)