Allow read-only arrays as input to remap#7535
Conversation
|
Is this ready for review? I feel like we should add a test for this right? |
This comment was marked as outdated.
This comment was marked as outdated.
|
Would love to see a similar change made to |
Workaround for scikit-image/scikit-image#6378 Can be removed after scikit-image/scikit-image#7535 is released.
Workaround for scikit-image/scikit-image#6378 Can be removed after scikit-image/scikit-image#7535 is released.
📝 WalkthroughWalkthroughBumped minimum Cython from 3.0.8 to 3.0.10 in build configs, added Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pyproject.toml (1)
123-131:⚠️ Potential issue | 🔴 Critical
[build-system]Cython version not updated — build may fail withconstmemoryview syntax.Line 127 still pins
Cython>=3.0.8, while[project.optional-dependencies] build(line 51) was bumped to>=3.0.10. The comment on line 48 explicitly warns to keep these in sync. Since theconstmemoryview qualifier in_remap.pyxrequires ≥3.0.10, a build using only[build-system]requirements (e.g.,pip install .) could pick Cython 3.0.8/3.0.9 and fail to compile.Proposed fix
[build-system] build-backend = 'mesonpy' requires = [ 'meson-python>=0.16', - 'Cython>=3.0.8,!=3.2.0b1', + 'Cython>=3.0.10,!=3.2.0b1', 'pythran>=0.16', 'lazy_loader>=0.4', 'numpy>=2.0', ]
|
@lagru @stefanv I just ran into this in jni/skan#256 (and have heard of several other cases, just didn't have time to investigate), so I am hoping to revive this. 😊 I've merged in main, added some tests, and pushed to @stefanv's branch, so I hope this is good to go! I'm going to approve but another read through by @lagru would be appreciated! 😊 |
|
@galenlynch thanks for chiming in! We should definitely do this for many of our Cython functions, but we should probably keep PRs small to help get them in quickly. If you would like to directly contribute a fix for marching cubes, we would appreciate it, otherwise, we'll make a follow-up issue and get to it when we can... 😅 As you have seen it can take a while, but we do eventually get to things... 😅 |
lagru
left a comment
There was a problem hiding this comment.
I couldn't help but tweak the test a little bit since I had it checked out anyway.
Will merge if CI stays green. Thanks everyone. 😊
* origin/main: (27 commits) Move `_shared` to `_skimage2` (#8102) Port `pad_footprint` & `mirror_footprint` to `skimage2` (#8094) Add rescaling API to skimage2 (#8075) Move `skimage2` implementation into `_skimage2` (#8093) Undo (double) mirroring in `ski2.morphology.dilation` (#8060) Grammar (#8091) Move `ensure_spacing` into `skimage2` (#8067) Ensure that `skimage2` does not eagerly import `skimage` (#8087) Use lazy-loader 0.5 (#8080) MAINT: make ellipse fitting forward compatible (#8054) Avoid deprecated assign to ndarray.shape (#8020) Avoid circular import in `feature/corner.py` (#8077) Turn off coderabbit auto-labeling & label checks (#8070) Fix GIL being re-enabled by C++ extensions (#8059) Fix conventions following docstub and misc. (#8055) Port grayscale morphology operators to skimage2 (#8046) Add revised `peak_local_max` to `skimage2` (#8039) Allow read-only arrays as input to remap (#7535) Add `prescale` parameter to "blob functions" (#7858) Try to make coderabbit respect exisiting type labels (#8042) ...
Closes #6378.
This requires adding consts across a much larger portion of our Cython code, but this WIP illustrates how it can be done.
Release note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.