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

Repair CF writer tests failing with libnetcdf >= 4.9.0 #2412

Merged
merged 3 commits into from Mar 14, 2023

Conversation

sfinkens
Copy link
Member

@sfinkens sfinkens commented Mar 13, 2023

CF writer tests fail with libnetcdf4 >= 4.9.0, because they use the compression keyword argument, which is ignored by xarray (pydata/xarray#7388). To fix this, tie usage of the compression keyword to the xarray version. There's already an open PR, so we can assume that this will be fixed in the next minor release (xarray >= 2023.03).

My bad, sorry I missed that in #2390 .

@djhoese
Copy link
Member

djhoese commented Mar 13, 2023

I assume that once the xarray issue is fixed this will start failing? Can we check the netcdf version and the xarray version to have better control of this?

@sfinkens
Copy link
Member Author

I guess they would first issue a deprecation warning before dropping support for the zlib keyword. netcdf4-python currently supports both.

@djhoese
Copy link
Member

djhoese commented Mar 13, 2023

Could we then assume that this fix will be included in the next xarray release? I do see there is a PR started here: pydata/xarray#7551

If we assume the next xarray will pass all kwargs to libnetcdf, then could we have a check for the current xarray version and use zlib for it and every version before it and then for the next minor/feature release (assume not a bug fix release of xarray) we switch to the new kwarg (still dependent on libnetcdf)?

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Merging #2412 (41226ec) into main (1a785e5) will increase coverage by 0.01%.
The diff coverage is 99.59%.

@@            Coverage Diff             @@
##             main    #2412      +/-   ##
==========================================
+ Coverage   94.73%   94.74%   +0.01%     
==========================================
  Files         329      329              
  Lines       48733    48861     +128     
==========================================
+ Hits        46166    46295     +129     
+ Misses       2567     2566       -1     
Flag Coverage Δ
behaviourtests 4.42% <4.89%> (+0.01%) ⬆️
unittests 95.37% <99.59%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/tests/writer_tests/test_cf.py 99.60% <98.70%> (-0.12%) ⬇️
satpy/composites/__init__.py 91.20% <100.00%> (+0.64%) ⬆️
satpy/tests/enhancement_tests/test_ahi.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_fy4_base.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_ghi_l1.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_msi_safe.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_msu_gsa_l1b.py 100.00% <100.00%> (ø)
...tpy/tests/reader_tests/test_oceancolorcci_l3_nc.py 100.00% <100.00%> (ø)
satpy/tests/test_composites.py 100.00% <100.00%> (ø)
satpy/tests/test_readers.py 98.89% <100.00%> (-0.01%) ⬇️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sfinkens
Copy link
Member Author

I don't know if that's a valid assumption :D But I think it's a good idea. If that PR doesn't make it into the next xarray release, our tests will remind us.

@sfinkens sfinkens marked this pull request as ready for review March 13, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants