Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 7a17f0c

Browse files
Merge pull request #247 from openclimatefix/issue/topo-validation
make sure no nans in the topological data
2 parents 5400adb + 3eef336 commit 7a17f0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nowcasting_dataset/data_sources/topographic/topographic_model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ class Topographic(DataSourceOutput):
1818
__slots__ = ()
1919
_expected_dimensions = ("x", "y")
2020

21-
# todo add validation here - https://github.com/openclimatefix/nowcasting_dataset/issues/233
21+
@classmethod
22+
def model_validation(cls, v):
23+
""" Check that all values are non NaNs """
24+
assert (v.data != np.NaN).all(), f"Some topological data values are NaNs"
25+
return v
2226

2327

2428
class TopographicML(DataSourceOutputML):

0 commit comments

Comments
 (0)