| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| if norm and (xx.max() > 1 or xx.min() < 0): | ||
| if norm and ( | ||
| np.any(np.isnan(xx)) or (xx.max() > 1 or xx.min() < 0) | ||
| ): |
There was a problem hiding this comment.
Rewrite as
if not (xx.min() >= 0 and xx.max() <= 1) (with a comment explaining that this form also excludes nans) and no extra nan checking to save a tiny bit of performance?
Sorry, something went wrong.
|
I checked out this branch and found it does not affect the examples in #27301. I think because norm is False. Unless I've done something silly, which is always possible... |
Sorry, something went wrong.
As there were doubts about how to handle it (and now if it actually works), it is probably better that I do not approve (only) based on seemingly sensible code.
| Back | FazBrowse Home | New Git URL |
closes #27301
PR summary
The docstring says "values must be on [0, 1] gamut" as is our standard encoding for float RGB(A) arrays. We check that the min and max are not outside of this range, but due to the way comparisons work with np.nan our test erroneously passed.
This adds an explict check for np.nan
PR checklist