Skip to content

Route Index and NamedUnitRange constructors through to_range#190

Merged
mtfishman merged 1 commit into
mainfrom
mf/to_range
Jun 29, 2026
Merged

Route Index and NamedUnitRange constructors through to_range#190
mtfishman merged 1 commit into
mainfrom
mf/to_range

Conversation

@mtfishman

@mtfishman mtfishman commented Jun 28, 2026

Copy link
Copy Markdown
Member

Summary

Routes the NamedUnitRange{Name} constructor argument, and so Index, through to_range (introduced in ITensor/TensorAlgebra.jl#189), so the same constructor accepts an integer, an existing range, or, with GradedArrays loaded, a vector of sector-to-multiplicity pairs like Index([U1(0) => 2, U1(1) => 3]). This adds no dependency on GradedArrays: to_range dispatches on the argument type, and a caller writing the sector form already has GradedArrays loaded.

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.70%. Comparing base (7f17764) to head (50d3897).

Files with missing lines Patch % Lines
src/namedunitrange.jl 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #190      +/-   ##
==========================================
- Coverage   72.77%   72.70%   -0.07%     
==========================================
  Files          28       28              
  Lines        1480     1484       +4     
==========================================
+ Hits         1077     1079       +2     
- Misses        403      405       +2     
Flag Coverage Δ
docs 22.00% <66.66%> (+0.02%) ⬆️

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.

@mtfishman mtfishman force-pushed the mf/to_range branch 4 times, most recently from d94f4e4 to 479804b Compare June 29, 2026 00:12
## Summary

Routes the `NamedUnitRange{Name}` length argument, and so `Index`, through `to_range` (introduced in ITensor/TensorAlgebra.jl#189), collapsing the separate integer and range constructors into one. `Index` now uniformly accepts an integer, an existing range, or, with GradedArrays loaded, a vector of sector-to-multiplicity pairs like `Index([U1(0) => 2, U1(1) => 3])`. This adds no dependency on GradedArrays: `to_range` dispatches on the spec type, and a caller writing the sector form already has GradedArrays loaded.
@mtfishman mtfishman changed the title [WIP] Route Index and NamedUnitRange constructors through to_range Route Index and NamedUnitRange constructors through to_range Jun 29, 2026
@mtfishman mtfishman marked this pull request as ready for review June 29, 2026 00:56
@mtfishman mtfishman enabled auto-merge (squash) June 29, 2026 00:58
@mtfishman mtfishman merged commit 997f92c into main Jun 29, 2026
26 of 28 checks passed
@mtfishman mtfishman deleted the mf/to_range branch June 29, 2026 01:16
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