-
Notifications
You must be signed in to change notification settings - Fork 300
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
Fix default AWIPS tiled _FillValue of -1 for newer versions of xarray #2858
Fix default AWIPS tiled _FillValue of -1 for newer versions of xarray #2858
Conversation
Merging this could wait a bit for the discussion in the xarray PR to settle to know if this is needed at all. Either way, the datetime change in this PR should be included. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2858 +/- ##
==========================================
- Coverage 95.95% 95.95% -0.01%
==========================================
Files 366 366
Lines 53619 53617 -2
==========================================
- Hits 51452 51448 -4
- Misses 2167 2169 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 9979397064Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Oh I should have made this a draft instead of just posting my previouscomment. I have an xarray PR that should make this unnecessary. |
Ah, sorry, missed the comment... |
Fixes compatibility with (currently unstable) xarray for the AWIPS tiled (
awips_tiled
) writer when using the default_Unsigned
fill value of-1
. Starting withpydata/xarray#9136
Xarray automatically converts the _FillValue to the proper dtype in a way that does not allow (or rather numpy does not allow) certain values to be automatically cast between types. In the case of this -1 it was trying to cast it directly to the unsigned type (give or take some bit depth differences) and failing. The -1 was just a convenience in the writer code anyway. I've added the necessary code to specify the fill value as the unsigned numpy type so that xarray can convert it when the file is saved.
AUTHORS.md
if not there already