You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quantity issue with np.ma.std and np.ma.var #10792
@larrybradley - Quantity has never really interacted well with masked arrays, sadly. The problem is that both override standard numpy behaviour, and the way they do it interferes with each other. So, I fear "upstream fix required" is the right answer.... That said, it may be worth checking what exactly goes wrong in your examples, since it may be fixable (my guess is that np.ma.var is the culprit, and np.ma.std just a consequence of taking a square room after, but I haven't actually looked...)
Activity
mhvk commentedon Oct 2, 2020
@larrybradley -
Quantityhas never really interacted well with masked arrays, sadly. The problem is that both override standard numpy behaviour, and the way they do it interferes with each other. So, I fear "upstream fix required" is the right answer.... That said, it may be worth checking what exactly goes wrong in your examples, since it may be fixable (my guess is thatnp.ma.varis the culprit, andnp.ma.stdjust a consequence of taking a square room after, but I haven't actually looked...)mhvk commentedon Apr 12, 2021
Going to call this fixed by #11127 even if that really means one has to use our own
Maskedclass.larrybradley commentedon Aug 5, 2021
@mhvk The
Maskedclass is great! Any chance this will make its way tonumpy? 😃It might be good to mention somewhere in the
Maskeddocumentation thatMaskedobjects shouldn't be used withnp.mafunctions:mhvk commentedon Aug 5, 2021
I've been meaning to at least let numpy know about this, but I think the chance that it will get in is tiny...
But, yes, you are right it should be documented that one should not use the
np.mafunctions!