Skip to content

Turn match() into a generic for specialization by other BiocPy classes.#38

Merged
jkanche merged 8 commits intomasterfrom
rematch
Apr 17, 2026
Merged

Turn match() into a generic for specialization by other BiocPy classes.#38
jkanche merged 8 commits intomasterfrom
rematch

Conversation

@LTLA
Copy link
Copy Markdown
Member

@LTLA LTLA commented Jan 8, 2026

Introduce a create_match_index generic that builds the matching index from a given 'targets' so that it can be easily reused across different 'x'. An example of a compatible index is provided by the new MatchIndex class.

Also added dedicated optimization for Factor matching, which exploits the fact that unique levels are already available.

LTLA and others added 2 commits January 8, 2026 17:58
Introduce a create_match_index generic that builds the matching index from a
given 'targets' so that it can be easily reused across different 'x'. An
example of a compatible index is provided by the new MatchIndex class.

Also added dedicated optimization for Factor matching, which exploits the
fact that unique levels are already available.
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 91.89189% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.95%. Comparing base (f242e80) to head (59ba6d5).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/biocutils/match.py 91.78% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #38      +/-   ##
==========================================
- Coverage   91.01%   90.95%   -0.07%     
==========================================
  Files          43       43              
  Lines        1837     1891      +54     
  Branches      375      394      +19     
==========================================
+ Hits         1672     1720      +48     
- Misses        113      116       +3     
- Partials       52       55       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

LTLA and others added 4 commits January 8, 2026 18:03
This avoids hard-coding None and numpy.ma.masked as unmatchable elements. The
default is an empty set, which means that None values can now be matched; this
is more consistent with the default behavior of R's match().
@jkanche jkanche self-assigned this Apr 17, 2026
@jkanche jkanche merged commit 2490e9b into master Apr 17, 2026
21 checks passed
@jkanche jkanche deleted the rematch branch April 17, 2026 15:59
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.

2 participants