Skip to content

Replace deprecated np.in1d with np.isin#113

Merged
marcovarrone merged 1 commit intomainfrom
fix-in1d
Mar 2, 2026
Merged

Replace deprecated np.in1d with np.isin#113
marcovarrone merged 1 commit intomainfrom
fix-in1d

Conversation

@marcovarrone
Copy link
Collaborator

@marcovarrone marcovarrone commented Mar 2, 2026

Summary by CodeRabbit

  • Refactor
    • Updated internal component labeling logic to use optimized approach, improving code maintainability while preserving existing functionality.

@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6dea763 and 36126d6.

📒 Files selected for processing (1)
  • src/cellcharter/gr/_build.py

📝 Walkthrough

Walkthrough

A single function call replacement in the component labeling module, changing from np.in1d() to np.isin() for evaluating membership of labels in small components. This modernizes the numpy API usage while maintaining existing logic.

Changes

Cohort / File(s) Summary
Numpy API Modernization
src/cellcharter/gr/_build.py
Replaced deprecated np.in1d() with np.isin() for membership evaluation in small component masking logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A rabbit hops through code so neat,
Swapping functions, what a treat!
in1d becomes isin with grace,
Modern numpy takes its place,
Cleaner logic, faster pace! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: replacing a deprecated NumPy function (np.in1d) with its modern equivalent (np.isin), which directly matches the file modification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-in1d

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@marcovarrone marcovarrone merged commit 7cb817f into main Mar 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant