Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRIB Data Example is broken #7892

Closed
mktippett opened this issue Jun 5, 2023 · 1 comment · Fixed by #7888
Closed

GRIB Data Example is broken #7892

mktippett opened this issue Jun 5, 2023 · 1 comment · Fixed by #7888

Comments

@mktippett
Copy link

What is your issue?

The example at https://docs.xarray.dev/en/stable/examples/ERA5-GRIB-example.html fails with an error. The command that fails is

ds = xr.tutorial.load_dataset("era5-2mt-2019-03-uk.grib", engine="cfgrib")

And the error is

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[2], line 1
----> 1 ds = xr.tutorial.load_dataset("era5-2mt-2019-03-uk.grib", engine="cfgrib")

File ~/checkouts/readthedocs.org/user_builds/xray/checkouts/stable/xarray/tutorial.py:206, in load_dataset(*args, **kwargs)
    169 def load_dataset(*args, **kwargs) -> Dataset:
    170     """
    171     Open, load into memory, and close a dataset from the online repository
    172     (requires internet).
   (...)
    204     load_dataset
    205     """
--> 206     with open_dataset(*args, **kwargs) as ds:
    207         return ds.load()

File ~/checkouts/readthedocs.org/user_builds/xray/checkouts/stable/xarray/tutorial.py:161, in open_dataset(name, cache, cache_dir, engine, **kws)
    159 # retrieve the file
    160 filepath = pooch.retrieve(url=url, known_hash=None, path=cache_dir)
--> 161 ds = _open_dataset(filepath, engine=engine, **kws)
    162 if not cache:
    163     ds = ds.load()

File ~/checkouts/readthedocs.org/user_builds/xray/checkouts/stable/xarray/backends/api.py:552, in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, chunked_array_type, from_array_kwargs, backend_kwargs, **kwargs)
    549 if from_array_kwargs is None:
    550     from_array_kwargs = {}
--> 552 backend = plugins.get_backend(engine)
    554 decoders = _resolve_decoders_kwargs(
    555     decode_cf,
    556     open_backend_dataset_parameters=backend.open_dataset_parameters,
   (...)
    562     decode_coords=decode_coords,
    563 )
    565 overwrite_encoded_chunks = kwargs.pop("overwrite_encoded_chunks", None)

File ~/checkouts/readthedocs.org/user_builds/xray/checkouts/stable/xarray/backends/plugins.py:205, in get_backend(engine)
    203     engines = list_engines()
    204     if engine not in engines:
--> 205         raise ValueError(
    206             f"unrecognized engine {engine} must be one of: {list(engines)}"
    207         )
    208     backend = engines[engine]
    209 elif isinstance(engine, type) and issubclass(engine, BackendEntrypoint):

ValueError: unrecognized engine cfgrib must be one of: ['netcdf4', 'h5netcdf', 'scipy', 'store', 'zarr']

Correct behavior here https://github.com/pydata/xarray/blob/main/doc/examples/ERA5-GRIB-example.ipynb

@mktippett mktippett added the needs triage Issue that has not been reviewed by xarray team member label Jun 5, 2023
@kmuehlbauer kmuehlbauer added topic-documentation and removed needs triage Issue that has not been reviewed by xarray team member labels Jun 5, 2023
@kmuehlbauer
Copy link
Contributor

@mktippett Thanks for raising this. The issue should be cleared after #7888 is merged.

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

Successfully merging a pull request may close this issue.

2 participants