Repository navigation
Conversation
Read columns by index for plain tuple rows. Keep the shortest row as the column limit. Co-Authored-By: Aiden <aiden@weco.ai>
This branch has not been deployed
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.
TL;DR
create_param_combssaves 47,433,280 bytes of peak allocation when building a grid of 398,000 window-pair and threshold combinations.What & Why
Transposing rows with
zip(*rows)keeps an iterator alive for each row. Plain tuples already support direct access by index.The helper takes a snapshot of the rows and reads one column at a time. The shortest row sets the column count, so uneven rows still truncate at the same point.
Why this is safe and easy to maintain
The change fits in the existing flattening helper. The output stays unchanged, and other iterables still use the existing transpose operation. The parameter tests check column order for both simple and nested combinations.
Validation
The table shows median peak traced bytes for one call, including the returned lists.
Five window and threshold selections gave these results for the full grid and its edge cases.
Without allocation tracing, the median call took 97.7 ms before and 91.7 ms after (wall ratio 0.939) with default thread settings.
To reproduce the large grid measurement on each checkout, run this from the repository root.
Native test command (5 passed, one NumPy deprecation warning):
uv run --no-cache --no-project --python 3.12 --with '.[test]' python -B -m pytest -p no:cacheprovider -q tests/test_utils.py::TestParams tests/test_utils.py::TestMapping tests/test_utils.py::TestEnumAI assistance
This PR was prepared with AI assistance from Aiden. Candidates were tracked with Weco Observe.
Weco share link: https://dashboard.weco.ai/share/dsHaLmQEI7IQ3YPUXLd_9PX5Y1_0c8DG