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

Commit 8144c46

Browse files
committed
add test to check if satellite order is correct
1 parent 9c65894 commit 8144c46

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

nowcasting_dataset/data_sources/satellite/satellite_model.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
logger = logging.getLogger(__name__)
99

10+
satellite_expected_dims_order = (
11+
"example",
12+
"time_index",
13+
"channels_index",
14+
"y_geostationary_index",
15+
"x_geostationary_index",
16+
)
17+
1018

1119
class Satellite(DataSourceOutput):
1220
"""Class to store satellite data as a xr.Dataset with some validation"""

tests/data_sources/satellite/test_satellite_model.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
import pytest
77

88
from nowcasting_dataset.data_sources.fake.batch import satellite_fake
9-
from nowcasting_dataset.data_sources.satellite.satellite_model import Satellite
9+
from nowcasting_dataset.data_sources.satellite.satellite_model import (
10+
Satellite,
11+
satellite_expected_dims_order,
12+
)
1013

1114

1215
def test_satellite_init(): # noqa: D103
@@ -15,6 +18,12 @@ def test_satellite_init(): # noqa: D103
1518
assert satellite.x_geostationary.dims == ("example", "x_geostationary_index")
1619

1720

21+
def test_satellite_dims_order(): # noqa: D103
22+
satellite = satellite_fake()
23+
satellite = Satellite.model_validation(satellite)
24+
assert satellite.data.dims == satellite_expected_dims_order
25+
26+
1827
def test_satellite_validation(): # noqa: D103
1928
sat = satellite_fake()
2029

0 commit comments

Comments
 (0)