Conversation
There was a problem hiding this comment.
Pull request overview
Replaces deprecated np.in1d calls with np.isin (deprecated in NumPy 2.0, removed in 2.4.0) and pins numpy>=1.13.0 (when np.isin was introduced) in build/runtime requirements.
Changes:
- Swap
np.in1d→np.isinin four modules. - Pin
numpy>=1.13.0inrequirements.txtandpyproject.toml.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| requirements.txt | Pin numpy>=1.13.0 for runtime. |
| pyproject.toml | Pin numpy>=1.13.0 for build requirements. |
| cortex/utils.py | Replace two np.in1d calls with np.isin. |
| cortex/surfinfo.py | Replace np.in1d with np.isin in list comprehension. |
| cortex/segment.py | Replace np.in1d with np.isin in flatten_slim. |
| cortex/rois.py | Replace two np.in1d calls with np.isin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request replaces the deprecated np.in1d function with np.isin across several modules and updates the project's dependencies to require NumPy 1.13.0 or higher. The review feedback correctly identifies opportunities to simplify the code by removing redundant .reshape() and .flatten() calls, as np.isin preserves the shape of the input array unlike its predecessor.
`isin` preserves shapes of original array Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
in1dwas deprecated in numpy 2.0 in favor ofisinand removed in numpy 2.4.0.Also updated
requirements.txtandpypoject.tomlto specifynumpy>=1.13.0, whenisinwas first introduced.