-
Notifications
You must be signed in to change notification settings - Fork 303
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
ValueError: unexpected encoding for scipy backend: ['chunksizes'] #1853
Comments
Interestingly, a fix is also available:
After installing it, the error is gone. I am a bit hesitant to call this a bug because it is likely an obscure error thrown by the omission of a necessary dependency for Satpy to work properly with NetCDF4 files. Still, I am posting it here, because:
|
@christianversloot thanks a lot for reporting this! It is indeed a good thing to have this shown here, at least so that other users encountering the same error can find the solution. Regarding what satpy should do about it: We have chosen not to put the full requirements for all the functionality in the setup.py, but rather to use the "extra" requirement syntax. For the cf writer, we have https://github.com/pytroll/satpy/blob/main/setup.py#L67 of course, it might not be obvious when you install satpy that you need just that extra requirement, and xarray can use multiple backends to write to netcdf, so we can end up in the kind of situation that you had here if you already have scipy installed. So as you say, a fix could be to check that either h5netcdf or netcdf4 is installed before doing the writing. Do you want to have a shot at a PR? |
Thanks for your quick response! I have reserved some time in my agenda to take a look at creating a PR on Monday. Per https://stackoverflow.com/questions/49222824/make-an-either-or-distinction-for-install-requires-in-setup-py/49222904, my approach would be to adapt
Can you let me know your preference? |
My vote is to leave the I think what @mraspaud was hoping for is in the |
That makes sense. Would look like this, which I find somewhat ugly though:
If you agree, I'll add this to the |
Slightly cleaner perhaps is to put the The check for the import should probably go in the |
How about simplifying slightly (no additional variables): try:
import netcdf4
except ImportError:
netcdf4 = None
...
if not netcdf4 and not h5netcdf:
... |
PR opened. |
Describe the bug
I have created a pipeline which loads MSG Native
*.nat
files, resamples them using a custom AreaDefinition and then uses the NetCDF writer to create*.nc
files. I used Windows for development.To Reproduce
This is the relevant code, because the problem happens internally:
Expected behavior
A
*.nc
file is created with my resampled satellite channels.Actual results
On Windows, this works. On Linux, both in and outside of a Docker container, I am however getting the following error:
ValueError: unexpected encoding for scipy backend: ['chunksizes']
The full stack trace suggests that this happens in
xarray
'sscipy
backend:Screenshots
If applicable, add screenshots to help explain your problem.
Environment Info:
from satpy.utils import check_satpy; check_satpy()
]Additional context
The text was updated successfully, but these errors were encountered: