Skip to content

Commit

Permalink
Test dtype also for computed data
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed Nov 2, 2024
1 parent 61914ac commit 20d79de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions satpy/tests/test_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def test_default_settings(self, sunz_ds1, sunz_sza, dtype):
res = self.default((sunz_ds1.astype(dtype), sunz_sza.astype(dtype)), test_attr="test")
expected = np.array([[0.02916261, 0.02839063], [0.02949383, 0.02871911]], dtype=dtype)
assert res.dtype == dtype
np.testing.assert_allclose(res.values,
values = res.values
assert values.dtype == dtype
np.testing.assert_allclose(values,
expected,
rtol=2e-5)

Expand All @@ -212,7 +214,9 @@ def test_custom_settings(self, sunz_ds1, sunz_sza, dtype):
res = self.custom((sunz_ds1.astype(dtype), sunz_sza.astype(dtype)), test_attr="test")
expected = np.array([[0.01041319, 0.01030033], [0.01046164, 0.01034834]], dtype=dtype)
assert res.dtype == dtype
np.testing.assert_allclose(res.values,
values = res.values
assert values.dtype == dtype
np.testing.assert_allclose(values,
expected,
rtol=1e-5)

Expand Down

0 comments on commit 20d79de

Please sign in to comment.