Repository navigation
Conversation
Indexing and to_ak() on (b, p, ~v, ~w) arrays ignored the fixed p axis. Route R=2 arrays with rag_dim > 1 through the multidim segment gather, peel all-int leading keys on R=2, and wrap fixed leading dims in RegularArray in the numeric R=2 to_ak path. Closes #73 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Record to_ak() zipped per row (depth_limit=1) when rag_dim <= 1 but at
the leaf when rag_dim > 1, so rec.to_ak()[k] and rec[k].to_ak() could
disagree. Always build leaf-level records, and stop wrapping trailing
fixed dims in RegularArray: they already live in each field's leaf.
BREAKING CHANGE: Ragged record to_ak() for arrays with one leading axis
now returns records at the leaf (e.g. 2 * var * {a, b}) instead of one
record of lists per row.
Closes #75
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A tuple key after a non-int key was applied to axis 0 of the intermediate result, so rag[:, 0] on (n, ~) returned row 0 instead of the first element of every row, and keys reaching ragged or trailing axes after a slice indexed the wrong axis. Track the output axis each key targets. Leading fixed axes are still indexed jointly; ragged axes take an int (per-row element) or a step-1 slice (Python semantics, negative bounds included); trailing axes index the data buffer. Unsupported combinations raise NotImplementedError instead of returning wrong data. Also vectorize the R=2 inner int-array gather and drop the now-dead _getitem_inner/_is_full_slice. BREAKING CHANGE: rag[:, k] and similar tuple keys now follow NumPy and awkward semantics; code relying on the old axis-0 behavior must index rows directly (rag[k]). Closes #74 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Merging this PR will degrade performance by 23.03%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_bench_baseline_ragged_short_alleles |
2.8 ms | 4.4 ms | -36.01% |
| ❌ | test_bench_dense_batch |
2.7 ms | 3.3 ms | -18.32% |
| ❌ | test_bench_baseline_ragged_cres |
6.3 ms | 7.3 ms | -12.73% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix-73 (ff1f21a) with main (63a8439)
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.
Fixes three
Raggedbugs: indexing that silently returned wrong data, and oneto_ak()inconsistency. Each fix is its own commit.#73: fixed axis before two ragged axes
(b, p, ~v, ~w)arrays (gvl 0.43_FlatWindow.to_ragged()) ignoredpin indexing andto_ak().r[i, j] == r[i][j].to_ak()wraps fixed leading dims inRegularArray.#74: tuple keys applied to axis 0 (breaking)
A key after a non-int key went to axis 0 of the intermediate result. For example,
rag[:, 0]on(n, ~)returned row 0.NotImplementedError: stepped slices, fancy keys on a ragged axis (except the first of two ragged axes), and trailing keys on records.#75: record
to_ak()depth (breaking)Records are now always at the leaf, whatever
rag_dimis, sorec.to_ak()[k] == rec[k].to_ak(). This also fixes trailing fixed dims being wrapped twice.Breaking changes
rag[:, k]and similar tuple keys follow NumPy semantics. To get rowk, userag[k].to_ak()with one leading axis returnsn * var * {a, b}instead of one record of lists per row.gvl's
values[:, t]only indexes leading axes, so it is not affected. No downstream repo callsto_ak()on a record.Testing
tests/test_ragged_nested_fixed_axis.pyandtests/test_ragged_tuple_index.pycheck results against awkward indexing on the same data. They cover packed and gathered offsets, strings, and records.skills/seqpro/SKILL.mdis updated.Closes #73
Closes #74
Closes #75
🤖 Generated with Claude Code