Change default CF writer engine to follow xarray defaults #844
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Xarray has default engine choices based on what is available in the current environment. It prefers to use netcdf4-python if available, otherwise
scipy
. It is also possible to tell xarray to useh5netcdf
. Right now Satpy defaults toh5netcdf
regardless of what is installed. This has caused unexpected results for some users (at least me) where they're able to read NetCDF files with theabi_l1b
reader, but can't write NetCDF files with thecf
writer because they don't haveh5netcdf
installed.This PR changes the default to
None
which means "let xarray choose". The biggest issue with doing this is that it seems xarray doesn't useh5netcdf
unless it is explicitly asked for. So if someone only hadh5netcdf
installed or was using an h5netcdf-only feature they would have to explicitly specify the engine. The other better option would be to make our own "try importing these backends and use that backend if successful" where we include h5netcdf as one of the options. Or we could make a PR to xarray to addh5netcdf
as one of the options.The only other thing I considered adding to this PR, similar to the above point, is importing one of the netcdf backends in the module level so that things like
available_writers
andcheck_satpy
would "know" if one of the dependencies was installed. Thoughts? I'm not sure whether to mark this as a "bug" or "backwards-incompatibility".This PR also includes some sphinx docs clean up.
flake8 satpy