Compare BiTuple by its flat contents - #220
Merged
Merged
Conversation
Lets an `AbstractArray` whose `axes` return a `BiTuple` flow through generic array machinery. `BiTuple` already acts like its flat tuple for iteration and indexing, so this bridges the remaining Base entry points (index sets, shape and broadcast checks, reshape/permute tuple helpers, `show`) and TensorAlgebra's `matricize` helpers to flatten it. Single-argument `map` preserves the split.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #220 +/- ##
==========================================
- Coverage 81.47% 81.40% -0.07%
==========================================
Files 28 28
Lines 1015 1022 +7
==========================================
+ Hits 827 832 +5
- Misses 188 190 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Equality and hash now ignore the codomain/domain split, matching how array equality ignores block partitioning. Broadcast and array-arithmetic shape combining is owned by the consumer instead, so the `broadcast_shape`, `check_broadcast_shape`, and `promote_shape` bridges are no longer needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`safe_tail`, `tail`, `front`, `lastindex`, and the broadcast `_axes` existed only to flatten a `BiTuple` for Base's index and in-place-broadcast machinery. Their consumers are now handled in the consuming package (block-structure `isdiag`, block-data slicing, dense-into-block writes), so these are no longer reached. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Note that Base dispatches bounds-checking on the axes tuple, so a `BiTuple` never competes with Base's index-type specializations. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A BiTuple is a bipartition value for matricize, not an array's axes, so it should not stand in as one. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Equality and hashing now ignore a
BiTuple's bipartitioning, comparing it by its flat contents, alongside a few moreBiTupleoperations like split-preservingmapandbipartition.