Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit ca22a68

Browse files
committed
Add tests for NaNs
1 parent bdbfd30 commit ca22a68

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
from ocf_datapipes.validation import CheckNaNs
2+
import pytest
3+
import numpy as np
24

5+
def test_check_nans_fail_dataarray(topo_dp):
6+
topo_dp = CheckNaNs(topo_dp)
7+
with pytest.raises(Exception):
8+
next(iter(topo_dp))
39

4-
def test_check_nans():
5-
pass
10+
def test_check_nans_fill(topo_dp):
11+
topo_dp = CheckNaNs(topo_dp, fill_nans=True)
12+
data = next(iter(topo_dp))
13+
assert np.all(data != np.nan)

0 commit comments

Comments
 (0)