Skip to content

Commit

Permalink
Tentative test for bug #52
Browse files Browse the repository at this point in the history
  • Loading branch information
jranalli committed Sep 16, 2022
1 parent 0bac672 commit 5c941d6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/test/test_devbugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,20 @@ def test_bug_git47(self):
# It can also happen to the temperature
T = w.state(T=300, p=[1, 1e10])['T']
assert not np.isnan(T[0])
assert np.isnan(T[1])
assert np.isnan(T[1])

def test_bug_git52(self):
# ig, ig2, igmix, mp1
subs = [pm.get("ig.BH3O3"), pm.get("ig.O2"), pm.get('ig.air'), pm.get('mp.H2O')]

for sub in subs:
p = 1
T = 500
h = sub.h(T=T, p=p)
s = sub.s(T=T, p=p)
assert sub.T_s(s, p) == approx(sub.T_s(s=s, p=p))
assert sub.T_h(h, p) == approx(sub.T_h(h=h, p=p))
if hasattr(sub, "p_s"):
assert sub.p_s(s, T) == approx(sub.p_s(s=s, T=T))
if hasattr(sub, "d_s"):
assert sub.d_s(s, T) == approx(sub.d_s(s=s, T=T))

0 comments on commit 5c941d6

Please sign in to comment.