-
-
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
Combine UnsignedIntegerCoder
and CFMaskCoder
#9266
Comments
I will try my best, but no guarantees on timeliness. I'll mostly be using this as yet another source of procrastination on the work I'm supposed to be doing. Anyway... I think the high-level summary of our discussion on my PR (#9258) and the PR that came before it (#9136) as far as changes needed are:
@dcherian you seemed to know that xarray can't load integer arrays as integers and instead produces floats. Is this by design or something that is too complicated to fix? |
The reason for this is that there is no representation for masked arrays with dtypes other than The logic is here: Lines 49 to 88 in ad35a10
To fix that we need one of (or both):
Both of these are sufficiently hard to get right that nothing other than the pandas extension dtypes exist (that I'm aware of). To give you an idea of how hard this is, there are several deferred NEPs that attempt to resolve this (NEPs 12, 24, 25, 26). |
Well it seems obvious when you say it like that 😉 Ok so I was focused on the encoding/decoding of dtypes, but it is more about the masking and operations that need to know the validity of a value. So while I might know that my data quality flag that is uint8 where a value of 1 means "bad"/mask, that doesn't mean that any numpy operation will know that even though I probably wouldn't use the variable in normal arithmetic operations anyway. |
FYI I'm almost done with this at least as a first draft. I'll need to clean it up a lot as right now it is mostly a copy/paste job. Right now I'm just trying to get tests to pass and make sense. The hardest part is figuring out when things should be in |
Closed by #9274 |
What is your issue?
Longer discussion here: #9258 (comment) but fundamentally, it's not possible to handle the
_Unsigned
attribute and masking separately so we'll need to merge these.@djhoese will you be able to send a PR for this please?
The text was updated successfully, but these errors were encountered: