-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Can't open datasets with the rasterio
engine.
#7831
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
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 |
Maybe it would also help to rephrase the error, something along the lines "Engine |
Yet another idea would be to add and |
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 |
I think this can be closed as it was completed in #9294 xarray/xarray/backends/plugins.py Lines 202 to 207 in c98af19
No section in https://docs.xarray.dev/en/stable/ecosystem.html but I assume this is sufficient |
thanks! |
Thanks but to be honest I don't see the updated message as being much of an improvement over what came before, it's still very unclear what actually needs to be done, the first link buries the details quite far down and the second link is not relevant to this specific case. |
I found the flowchart at https://docs.xarray.dev/en/stable/user-guide/io.html to be quite helpful? From that flowchart and the rasterio section it seems (untested) that you just have to install
I'm not sure if In terms of error message this is perhaps a slightly better message f"unrecognized engine '{engine}' must be one of your download engines: {list(engines)}. "
- "To install additional dependencies, see:\n"
+ "To work with other data formats see:\n"
"https://docs.xarray.dev/en/stable/user-guide/io.html \n"
"https://docs.xarray.dev/en/stable/getting-started-guide/installing.html" with other improvements perhaps being wording in the linked docs |
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 require
rioxarray
?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:
The text was updated successfully, but these errors were encountered: