Skip to content

Complete the single-index set-operation helpers#221

Merged
mtfishman merged 1 commit into
mainfrom
mf/tryuniqueind
Jul 14, 2026
Merged

Complete the single-index set-operation helpers#221
mtfishman merged 1 commit into
mainfrom
mf/tryuniqueind

Conversation

@mtfishman

@mtfishman mtfishman commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Fills the single-index index-set helpers out into complete pairs. Each of the three index-set operations now has a plural form, an erroring single form, and a nothing-returning single form:

  • intersection: commoninds / commonind / trycommonind
  • set difference: uniqueinds / uniqueind / tryuniqueind
  • symmetric difference: noncommoninds / noncommonind / trynoncommonind

This adds the two that were missing, tryuniqueind and noncommonind, and fixes trynoncommonind, which despite its name returned the set difference (uniqueinds) rather than the symmetric difference (noncommoninds). It now returns the symmetric difference, so trynoncommonind is the nothing-returning counterpart of noncommonind and tryuniqueind is the counterpart of uniqueind. Code that wants the single index of a not in b should use tryuniqueind.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.13%. Comparing base (69bea45) to head (c38cf69).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   76.07%   76.13%   +0.05%     
==========================================
  Files          29       29              
  Lines        1693     1697       +4     
==========================================
+ Hits         1288     1292       +4     
  Misses        405      405              
Flag Coverage Δ
docs 26.75% <100.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Fills the single-index index-set helpers out into complete pairs. Each of the three index-set operations now has a plural form, an erroring single form, and a `nothing`-returning single form:

- intersection: `commoninds` / `commonind` / `trycommonind`
- set difference: `uniqueinds` / `uniqueind` / `tryuniqueind`
- symmetric difference: `noncommoninds` / `noncommonind` / `trynoncommonind`

This adds the two that were missing, `tryuniqueind` and `noncommonind`, and fixes `trynoncommonind`, which despite its name returned the set difference (`uniqueinds`) rather than the symmetric difference (`noncommoninds`). It now returns the symmetric difference, so `trynoncommonind` is the `nothing`-returning counterpart of `noncommonind` and `tryuniqueind` is the counterpart of `uniqueind`. Code that wants the single index of `a` not in `b` should use `tryuniqueind`.
@mtfishman
mtfishman merged commit a0e9e98 into main Jul 14, 2026
18 checks passed
@mtfishman
mtfishman deleted the mf/tryuniqueind branch July 14, 2026 20:03
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