Skip to content

Commit 571699a

Browse files
committed
add test
1 parent 4c2e6d3 commit 571699a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/unit/test_storage.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@
66
import activestorage.storage as st
77

88

9+
def test_mask_missing():
10+
"""Test mask missing."""
11+
missing_1 = ([-900.], np.array([-900.]), None, None)
12+
missing_2 = ([-900., 33.], np.array([-900., 33.]), None, None)
13+
data_1 = np.ma.array(
14+
[[[-900., 33.], [33., -900], [33., 44.]]],
15+
mask=False,
16+
fill_value=-900.0,
17+
dtype=float
18+
)
19+
data_2 = np.ma.array(
20+
[[[-900., 33.], [33., -900], [33., 44.]]],
21+
mask=False,
22+
fill_value=[-900.0, 33.],
23+
dtype=float
24+
)
25+
res_1 = st.mask_missing(data_1, missing_1)
26+
print(res_1)
27+
res_2 = st.mask_missing(data_2, missing_2)
28+
print(res_2)
29+
30+
931
def test_reduce_chunk():
1032
"""Test reduce chunk entirely."""
1133
rfile = "tests/test_data/cesm2_native.nc"

0 commit comments

Comments
 (0)