Skip to content

Commit

Permalink
Add tests for checking output for masked and dask arrays stay the same
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed Nov 30, 2018
1 parent 500dc7f commit 781e477
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pyspectral/tests/test_reflectance.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,22 @@ def test_reflectance(self):
tb3x = refl37.emissive_part_3x()
np.testing.assert_allclose(tb3x, 282.455426, 6)

sunz = np.array([50.])
tb3 = np.ma.masked_array([300.], mask=False)
tb4 = np.ma.masked_array([285.], mask=False)
refl = refl37.reflectance_from_tbs(sunz, tb3, tb4)
self.assertTrue(hasattr(refl, 'mask'))

try:
import dask.array as da
sunz = da.from_array([50.], chunks=10)
tb3 = da.from_array([300.], chunks=10)
tb4 = da.from_array([285.], chunks=10)
refl = refl37.reflectance_from_tbs(sunz, tb3, tb4)
self.assertTrue(hasattr(refl, 'compute'))
except ImportError:
pass

def tearDown(self):
"""Clean up"""
pass
Expand Down

0 comments on commit 781e477

Please sign in to comment.