Skip to content

Region-list indexing and incremental iter_regions - #6

Merged
xandergos merged 4 commits into
mainfrom
dev
Oct 23, 2026
Merged

xandergos merged 4 commits into
mainfrom
dev

Conversation

@xandergos

Copy link
Copy Markdown
Owner

Summary

  • tensor[[region_a, region_b, ...]] reads a list of regions in one go. Every window the regions need is computed in a single deduplicated pass, batched when batch_size is set, and cached until all the regions have been read.
  • New InfiniteTensor.iter_regions(regions) processes windows in region order, in full batches of batch_size. After each batch it yields the regions that are now complete. It takes lazy iterables, and if a window is evicted before its region is read, it gets recomputed.
  • README documents both.

Test plan

  • pytest: 91 passed (new TestRegionListIndexing and TestIterRegions cover ordering, batching, laziness, eviction, and empty input)

🤖 Generated with Claude Code

xandergos and others added 2 commits October 14, 2026 13:13
Indexing with a list now reads each element as its own region and returns
a list of tensors. All windows across regions are computed in one pass
(deduplicated and batched together) and stay cached until every region is
read. Adds the `sl` helper for building regions with bracket syntax.

Lists are no longer treated as a single multi-dimensional index, and
non int/slice/Ellipsis index elements now raise TypeError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Processes windows in region order in full batches of batch_size and
yields each batch's newly completed regions, so results stream out as
they are computed. Accepts lazy iterables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.26027% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infinite_tensor/infinite_tensor.py 98.38% 0 Missing and 1 partial ⚠️
infinite_tensor/utils.py 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

xandergos and others added 2 commits October 23, 2026 14:20
Newer ruff formats Python code blocks in Markdown, which failed the
CI format check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xandergos
xandergos merged commit b2b4a33 into main Oct 23, 2026
8 checks passed
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