Open simonrp84 opened 1 year ago
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! If you have an idea for a solution, we would really welcome a Pull Request with proposed changes. See the Contributing Guide for more. It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better. Thank you!
I think this would be nice since we recently removed the rasterio backend.
I don't know how we would implement that, it's probably not a good idea to special case all external backends within xarray.
Either the package is installed and then it works or it is not installed and then we don't know which backend/package is missing.
I was suggesting to special-case rioxarray only just because we recently deleted the rasterio backend, and that might ease the transition. Can we do it at the top-level open-dataset when engine=="rasterio"
but rioxarray
is not importable?
Maybe it would also help to rephrase the error, something along the lines
"Engine rasterio
is not available. Please install the needed package. Engines [xxx, yyy, zzz] are available."
Yet another idea would be to add and Engines
heading on https://docs.xarray.dev/en/stable/ecosystem.html where engines/backends and there respective packages can be listed. The error could include a link to that page.
Thanks for the replies. Yes, that second suggestion sounds good @kmuehlbauer!
I realise it's not practical to add specific checks / messages for all engines, so something like this that links to a webpage that describes potential solutions seems like an excellent compromise. Your earlier solution (rephasing the error) I think would not help, however, as it still doesn't show users what the actual missing package is rioxarray
vs rasterio
.
What happened?
Hello, When using this command:
data = xr.open_dataset(my_filename, engine="rasterio")
I get an error:
ValueError: unrecognized engine rasterio must be one of: ['netcdf4', 'scipy', 'store', 'zarr']
This error is generated because I don't have
rioxarray
installed. However, that's not clear from the message and the user is likely to assume that it's because they don't haverasterio
installed. Would it be possible to improve this error message to allow the user to see that they requirerioxarray
?What did you expect to happen?
An error message to be displayed that helps the user understand which package is missing. Something like:
Minimal Complete Verifiable Example
Then, to generate the error: