File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 11import os
2-
32import pytest
4- import pandas as pd
3+
54import numpy as np
5+ import pandas as pd
66import xarray as xr
7-
8-
7+ import zarr
98
109
1110xr .set_options (keep_attrs = True )
@@ -16,15 +15,17 @@ def test_t0():
1615
1716
1817def make_sat_data (test_t0 , freq_mins ):
18+
1919 # Load dataset which only contains coordinates, but no data
20- ds = xr .open_zarr (
21- f"{ os .path .dirname (os .path .abspath (__file__ ))} /test_data/non_hrv_shell.zarr.zip"
22- )
20+ shell_path = f"{ os .path .dirname (os .path .abspath (__file__ ))} /test_data/non_hrv_shell.zarr.zip"
21+
22+ with zarr .ZipStore (shell_path , mode = 'r' ) as store :
23+ ds = xr .open_zarr (store )
2324
24- # remove tim dim and expand time dim to be len 36 = 3 hours of 5 minute data
25+ # Remove original time dim
2526 ds = ds .drop_vars ("time" )
2627
27- # Add times so they lead up to present
28+ # Add new times so they lead up to present
2829 times = pd .date_range (
2930 test_t0 - pd .Timedelta ("3h" ),
3031 test_t0 ,
You can’t perform that action at this time.
0 commit comments