| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| xa[xa == self.N] = self.N - 1 | ||
| # Avoid converting large positive values to negative integers. | ||
| np.clip(xa, -1, self.N, out=xa) | ||
| with np.errstate(invalid="ignore"): |
There was a problem hiding this comment.
Is the errstate even still needed? AFAICT casting nan to int doesn't trigger an "invalid" error.
Sorry, something went wrong.
There was a problem hiding this comment.
I get one with it and get lots of failures in the pytest suite without ignoring.
python -c "import numpy; numpy.array([numpy.nan]).astype(int)" <string>:1: RuntimeWarning: invalid value encountered in cast
Sorry, something went wrong.
…colormap lookups
…970-on-v3.7.x Backport PR #24970 on branch v3.7.x (FIX: Handle uint8 indices properly for colormap lookups)
| Back | FazBrowse Home | New Git URL |
PR Summary
Since we use subtraction to compute the lookup table indices we need to cast uints in addition to floats, so we can move the cast outside of the float block.
closes #24865
PR Checklist
Documentation and Tests
Release Notes