Repository navigation
Accept read-only input in more Cython kernels - #8426
Merged
Merged
Conversation
denoise_bilateral, denoise_tv_bregman, inpaint_biharmonic (mask), iradon_sart, area_opening, diameter_opening, max_tree and max_tree_local_maxima raised "buffer source array is read-only" for read-only arrays. The kernels only read these inputs, so the memoryviews are now const. The inpaint mask uses unsigned char because a const char memoryview does not accept bool arrays. Assisted-by: Claude Code:claude-opus-5-5
stefanv
approved these changes
Nov 20, 2026
Member
|
Thanks for this follow-up, @darskkaa 🙏 |
This was referenced Nov 24, 2026
eliem08
added a commit
to eliem08/scikit-image
that referenced
this pull request
Nov 24, 2026
… pass on main Drop the 7 new read-only tests that already pass on upstream main (scikit-image#8424/scikit-image#8426 landed the underlying fixes); only unwrap_phase and ORB still fail there. Keeps test_unwrap_phase_read_only, test_unwrap_phase_read_only_nan and test_orb_read_only. Signed-off-by: Ilyass Emssaad <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #8423, follow-up to #8424.
This is the same fix as #8424. Here I made the read-only inputs
constin the denoise, inpaint, radon and max_tree kernels, where the inpaint mask isconst unsigned char, sinceconst chardoes not accept bool arrays. I also left outunwrap_phase, as it involved changing the vendored C code.AI usage: I used Claude Code to make the
constchanges, then reviewed them and ran some existing tests locally.