Skip to content

ChebyshevTT.integrate: bounds-validation error messages reference storage-frame indices #20

@0xC000005

Description

@0xC000005

Summary

ChebyshevTT.integrate(dims=, bounds=) translates user-frame dims to
storage positions via a storage_for map (tensor_train.py:1567-1570),
then passes those storage-frame indices to _normalize_bounds in
_calculus.py. When a bound falls outside the domain, the resulting
error message references the storage-frame index, not the user-frame
index the caller passed.

Repro

tt = ChebyshevTT(domain=[(-1,1), (-2,2), (-3,3)], n_nodes=[5,7,3])
tt = tt.with_auto_order()
# Suppose with_auto_order produces _dim_order = [2, 0, 1]
# Storage frame: dim 0 = original dim 2, dim 1 = original dim 0, dim 2 = original dim 1

tt.integrate(dims=[1], bounds=[(5, 6)])  # user-frame dim 1 -> storage position 2
# Current error: "bounds (5, 6) out of domain ... for dim 2"
# User passed dim=1, sees dim=2 in error -- confusing

Impact

Cosmetic — only affects the error path on user input validation.
Correctness paths (in-domain integration) are unaffected.

Suggested fix

Either:

  1. Pass user-frame dim labels alongside storage indices to
    _normalize_bounds for message formatting
  2. Wrap _normalize_bounds in tensor_train.py to translate the index
    back to user frame before raising

Option 1 is cleaner.

Priority

Minor UX bug. Tracked from PR #18 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions