Skip to content

Commit

Permalink
maybe fixed up
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Oct 2, 2024
1 parent 31f0925 commit ce82811
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/pyscal/utils/relperm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def truncate_zeroness(
value: float, zeronesslimit: float = 1 / SWINTEGERS, name: str = "", log=True
value: float, zeronesslimit: float = 10 / SWINTEGERS, name: str = "", log=True
) -> float:
"""Check a value for closeness to zero, and return as zero if below
a given limit, if not return the value"""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_gaswater.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def check_endpoints(gaswater, krwend, krwmax, krgend):
"""Check that the code produces correct endpoints for
parametrizations, on discrete cases"""
swtol = 1 / SWINTEGERS
swtol = 10 / SWINTEGERS

# Check endpoints for gas curve:
# krg at swl should be krgend:
Expand Down Expand Up @@ -149,6 +149,7 @@ def test_gaswater_let1(l, e, t, krwend, krwmax):
st.booleans(),
)
def test_gaswater_krendmax(swl, swcr, sgrw, krgend, krwend, krwmax, h, fast):

"""Test endpoints for gaswater using hypothesis testing"""
try:
gaswater = GasWater(swl=swl, swcr=swcr, sgrw=sgrw, h=h, fast=fast)
Expand Down
12 changes: 5 additions & 7 deletions tests/test_slgof.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import hypothesis.strategies as st
import numpy as np
import pytest
from hypothesis import given, target
from hypothesis import given

from pyscal import GasOil, WaterOilGas
from pyscal.constants import EPSILON, SWINTEGERS
Expand Down Expand Up @@ -141,16 +141,14 @@ def test_slgof_hypo(swl, sorg, sgcr, h):
assert np.isclose(slgof["SL"].to_numpy()[-1], 1.0)
slgof_str = gasoil.SLGOF()
assert isinstance(slgof_str, str)
assert q
assert slgof_str
sat_table_str_ok(slgof_str)


@given(
swl=st.just(0.0), # st.floats(min_value=0.0, max_value=0.3),
sorg=st.just(1e-05), # st.floats(min_value=0.0, max_value=0.3),
h=st.just(
0.5
), # st.floats(min_value=1.0 / float(100 * SWINTEGERS), max_value=0.5),
st.floats(min_value=0.0, max_value=0.3),
st.floats(min_value=0.0, max_value=0.3),
st.floats(min_value=1.0 / float(100 * SWINTEGERS), max_value=0.5),
)
def test_slgof_sl_mismatch(swl, sorg, h):
"""Test numerical robustness on slgof table creation."""
Expand Down

0 comments on commit ce82811

Please sign in to comment.