Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match SWINTEGERS and saturation print format #458

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pyscal/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* ``MAX_EXPONENT_PC``: Maximal number for exponents in cap pressure parameterizations.
"""

SWINTEGERS: int = 10000
SWINTEGERS: int = 100000

EPSILON: float = 1e-08

Expand Down
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
2 changes: 1 addition & 1 deletion tests/test_gasoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_gasoil_init():

def test_conserve_sgcr(mocker):
"""sgcr in the table can be hard to conserve"""
low_sgcrvalue = 0.00001 # 1/10 of 1/SWINTEGERS
low_sgcrvalue = 1 / SWINTEGERS / 10
# Verify the default behaviour of truncation:
assert truncate_zeroness(low_sgcrvalue) == 0
mocker.patch(
Expand Down
2 changes: 1 addition & 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
4 changes: 2 additions & 2 deletions tests/test_slgof.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_numerical_problems(swl, sorg, sgcr):
st.floats(min_value=0.0, max_value=0.3),
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(1000 * SWINTEGERS), max_value=0.5),
st.floats(min_value=1.0 / float(100 * SWINTEGERS), max_value=0.5),
)
def test_slgof_hypo(swl, sorg, sgcr, h):
"""Shotgun-testing of slgof"""
Expand All @@ -148,7 +148,7 @@ def test_slgof_hypo(swl, sorg, sgcr, h):
@given(
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(1000 * SWINTEGERS), max_value=0.5),
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