Skip to content

Commit 4757a53

Browse files
committed
Ensure single chunk for all datasets
1 parent 48e364c commit 4757a53

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/climatebenchpress/data_loader/datasets/cams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def open(download_path: Path) -> xr.Dataset:
3737

3838
# Restrict data to a single day.
3939
# The specific day is arbitrary.
40-
ds = ds.sel(valid_time=slice("2023-06-15", "2023-06-15"))
40+
ds = ds.sel(valid_time=slice("2023-06-15", "2023-06-15")).chunk(-1)
4141
# Needed to make the dataset CF-compliant.
4242
ds.longitude.attrs["axis"] = "X"
4343
ds.latitude.attrs["axis"] = "Y"

src/climatebenchpress/data_loader/datasets/era5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def download(download_path: Path, progress: bool = True):
3434
"10m_u_component_of_wind",
3535
"10m_v_component_of_wind",
3636
]
37-
]
37+
].chunk(-1)
3838
# Needed to make the dataset CF-compliant.
3939
ds.time.attrs["standard_name"] = "time"
4040
ds.longitude.attrs["axis"] = "X"

src/climatebenchpress/data_loader/datasets/esa_biomass_cci.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import xarray as xr
77

88
from .. import (
9-
_rechunk_dataset,
109
open_downloaded_canonicalized_dataset,
1110
open_downloaded_tiny_canonicalized_dataset,
1211
)
@@ -51,8 +50,7 @@ def open(download_path: Path) -> xr.Dataset:
5150
ds = ds.sel(
5251
lon=slice(FRANCE_BBOX[0], FRANCE_BBOX[2]),
5352
lat=slice(FRANCE_BBOX[3], FRANCE_BBOX[1]),
54-
)
55-
ds = _rechunk_dataset(ds)
53+
).chunk(-1)
5654
return ds[["agb"]]
5755

5856

src/climatebenchpress/data_loader/datasets/nextgems.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def download(download_path: Path, progress: bool = True):
5656
idx = _get_nn_lon_lat_index(
5757
2**ZOOM, np.linspace(-180, 180, NUM_LON), np.linspace(-90, 90, NUM_LAT)
5858
)
59-
ds = ds.isel(cell=idx).chunk({"time": 1, "lat": NUM_LAT, "lon": NUM_LON})
59+
ds = ds.isel(cell=idx).chunk(-1)
6060
ds.lon.attrs["axis"] = "X"
6161
ds.lat.attrs["axis"] = "Y"
6262

0 commit comments

Comments
 (0)