File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1376,6 +1376,21 @@ def test_cropping() -> None:
13761376 assert test .ds .shape == (365 * 4 , 4 , 1 , 8 )
13771377
13781378
1379+ @mockup_open_zarr
1380+ def test_rolling_average () -> None :
1381+ """Test cropping a dataset."""
1382+ initial = DatasetTester ("test-2021-2021-6h-o96-abcd" )
1383+ test = DatasetTester (
1384+ "test-2021-2021-6h-o96-abcd" ,
1385+ rolling_average = (- 2 , 2 , "freq" ),
1386+ )
1387+ assert initial .ds .shape == (365 * 4 , 4 , 1 , 10 )
1388+ assert test .ds .shape == (365 * 4 - 4 , 4 , 1 , 10 )
1389+
1390+ diff = test .ds [0 ] - (initial .ds [0 :5 ].sum (axis = 0 ) / 5 )
1391+ assert np .abs (diff ).max () < 1e-5
1392+
1393+
13791394@mockup_open_zarr
13801395def test_invalid_trim_edge () -> None :
13811396 """Test that exception raised when attempting to trim a 1D dataset"""
You can’t perform that action at this time.
0 commit comments