Skip to content

Fix: do not pass storage_options into aiohttp#3

Open
tropicrainforest wants to merge 2 commits intomainfrom
not-pass-storage-options
Open

Fix: do not pass storage_options into aiohttp#3
tropicrainforest wants to merge 2 commits intomainfrom
not-pass-storage-options

Conversation

@tropicrainforest
Copy link
Contributor

This PR is going to fix the issue with storage_options={"simplecache": ...} that crashing with TypeError and compressed remote files (.grib2.bz2) failing with EOFError.

In [2]: import xarray as xr
   ...: import tempfile
   ...: 
   ...: URL = "https://opendata.dwd.de/weather/nwp/icon/grib/00/t_2m/icon_global_icosahedral_single-level_2026031300_000_T_2M.grib2.bz2"
   ...: 
   ...: with tempfile.TemporaryDirectory() as tmpdir:
   ...:     dset = xr.open_dataset(
   ...:         URL,
   ...:         engine="prism",
   ...:         storage_options={"simplecache": {"cache_storage": tmpdir}},
   ...:     )
   ...:     print(dset)
   ...: 
WARNING:cfgrib.dataset:ecCodes provides no latitudes/longitudes for gridType='unstructured_grid'
<xarray.Dataset> Size: 12MB
Dimensions:            (values: 2949120)
Coordinates:                                                                                                 
    time               datetime64[ns] 8B ...
    step               timedelta64[ns] 8B ...
    heightAboveGround  float64 8B ...
    valid_time         datetime64[ns] 8B ...
Dimensions without coordinates: values
Data variables:
    t2m                (values) float32 12MB ...
Attributes:
    GRIB_edition:            2
    GRIB_centre:             edzw
    GRIB_centreDescription:  Offenbach
    GRIB_subCentre:          255
    Conventions:             CF-1.7
    institution:             Offenbach
    history:                 2026-03-13T19:06 GRIB to CDM+CF via cfgrib-0.9.1...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant