Skip to content

Commit

Permalink
add tolerance to allclose
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Reep authored and Jeffrey Reep committed May 21, 2024
1 parent 29bc38b commit 16a81bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pydrad/parse/tests/test_strand.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ def test_term_file_output(strand):
for p in strand:
# The electron energy equation's numerical viscosity term is always 0:
assert u.allclose(p.electron_numerical_viscosity,
np.zeros_like(p.electron_numerical_viscosity)
np.zeros_like(p.electron_numerical_viscosity),
rtol=0.0, atol=1e-8*u.erg/u.s/u.cm**3,
)
# The hydrogen energy equation's gravity term is never 0:
assert not u.allclose(p.hydrogen_gravity,
np.zeros_like(p.hydrogen_gravity)
np.zeros_like(p.hydrogen_gravity),
rtol=0.0, atol=1e-8*u.erg/u.s/u.cm**3,
)

def test_term_file_units(strand):
Expand Down

0 comments on commit 16a81bf

Please sign in to comment.