1515def test_nwp_data_source_init (): # noqa: D103
1616 _ = NWPDataSource (
1717 zarr_path = NWP_ZARR_PATH ,
18- history_minutes = 30 ,
18+ history_minutes = 60 ,
1919 forecast_minutes = 60 ,
2020 )
2121
2222
2323def test_nwp_data_source_open (): # noqa: D103
2424 nwp = NWPDataSource (
2525 zarr_path = NWP_ZARR_PATH ,
26- history_minutes = 30 ,
26+ history_minutes = 60 ,
2727 forecast_minutes = 60 ,
2828 channels = ["t" ],
2929 )
@@ -34,7 +34,7 @@ def test_nwp_data_source_open(): # noqa: D103
3434def test_nwp_data_source_batch (): # noqa: D103
3535 nwp = NWPDataSource (
3636 zarr_path = NWP_ZARR_PATH ,
37- history_minutes = 30 ,
37+ history_minutes = 60 ,
3838 forecast_minutes = 60 ,
3939 channels = ["t" ],
4040 )
@@ -47,13 +47,17 @@ def test_nwp_data_source_batch(): # noqa: D103
4747
4848 batch = nwp .get_batch (t0_datetimes = t0_datetimes , x_locations = x , y_locations = y )
4949
50- assert batch .data .shape == (4 , 1 , 19 , 2 , 2 )
50+ # batch size 4
51+ # channel 1
52+ # time series, 1 int he past, 1 now, 1 in the future
53+ # x,y of size 2
54+ assert batch .data .shape == (4 , 1 , 3 , 2 , 2 )
5155
5256
5357def test_nwp_get_contiguous_time_periods (): # noqa: D103
5458 nwp = NWPDataSource (
5559 zarr_path = NWP_ZARR_PATH ,
56- history_minutes = 30 ,
60+ history_minutes = 60 ,
5761 forecast_minutes = 60 ,
5862 channels = ["t" ],
5963 )
@@ -68,13 +72,13 @@ def test_nwp_get_contiguous_time_periods(): # noqa: D103
6872def test_nwp_get_contiguous_t0_time_periods (): # noqa: D103
6973 nwp = NWPDataSource (
7074 zarr_path = NWP_ZARR_PATH ,
71- history_minutes = 30 ,
75+ history_minutes = 60 ,
7276 forecast_minutes = 60 ,
7377 channels = ["t" ],
7478 )
7579
7680 contiguous_time_periods = nwp .get_contiguous_t0_time_periods ()
7781 correct_time_periods = pd .DataFrame (
78- [{"start_dt" : pd .Timestamp ("2019-01-01 00:30 " ), "end_dt" : pd .Timestamp ("2019-01-02 01:00" )}]
82+ [{"start_dt" : pd .Timestamp ("2019-01-01 01:00 " ), "end_dt" : pd .Timestamp ("2019-01-02 01:00" )}]
7983 )
8084 pd .testing .assert_frame_equal (contiguous_time_periods , correct_time_periods )
0 commit comments