Skip to content

Commit

Permalink
Allow some tolerance in test comparison (#219)
Browse files Browse the repository at this point in the history
* Allow some tolerance in test comparison

Note that the default is relative tol = 1e-5 & absolute tol = 1e-8. I'm
also considering NaNs as equal values.

* Removing nan_equal

As suggested by @grantbuster since it was not supposed to have any NaN.
  • Loading branch information
castelao committed Jun 17, 2024
1 parent 4eb5022 commit 2f53a4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/forward_pass/test_forward_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def test_fwp_single_ts_vs_multi_ts_input_files():

with xr.open_dataset(sf) as s_res, xr.open_dataset(mf) as m_res:
for feat in model.meta['hr_out_features']:
assert np.array_equal(s_res[feat].values,
m_res[feat].values)
assert np.allclose(s_res[feat].values,
m_res[feat].values)


def test_fwp_spatial_only():
Expand Down

0 comments on commit 2f53a4c

Please sign in to comment.