diff --git a/activestorage/storage.py b/activestorage/storage.py index 65c648e..80a575b 100644 --- a/activestorage/storage.py +++ b/activestorage/storage.py @@ -49,7 +49,7 @@ def reduce_chunk(rfile, if tmp.size: return method(tmp), tmp.size else: - return tmp, None + return tmp, 0 else: return tmp, None diff --git a/tests/unit/test_storage.py b/tests/unit/test_storage.py index 1f04121..8e27972 100644 --- a/tests/unit/test_storage.py +++ b/tests/unit/test_storage.py @@ -60,7 +60,7 @@ def test_reduced_chunk_fully_masked_data_fill(): order="C", chunk_selection=ch_sel, method=np.mean) assert rc[0].size == 0 - assert rc[1] is None + assert rc[1] == 0 def test_reduced_chunk_fully_masked_data_missing(): @@ -79,7 +79,7 @@ def test_reduced_chunk_fully_masked_data_missing(): order="C", chunk_selection=ch_sel, method=np.mean) assert rc[0].size == 0 - assert rc[1] is None + assert rc[1] == 0 def test_reduced_chunk_fully_masked_data_vmin(): @@ -98,7 +98,7 @@ def test_reduced_chunk_fully_masked_data_vmin(): order="C", chunk_selection=ch_sel, method=np.mean) assert rc[0].size == 0 - assert rc[1] is None + assert rc[1] == 0 def test_reduced_chunk_fully_masked_data_vmax(): @@ -117,7 +117,7 @@ def test_reduced_chunk_fully_masked_data_vmax(): order="C", chunk_selection=ch_sel, method=np.mean) assert rc[0].size == 0 - assert rc[1] is None + assert rc[1] == 0 def test_zero_data():