Skip to content

Don't interpolate array into ArgumentError #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DanielVandH
Copy link
Contributor

For small matrices interpolating isn't awful,

ERROR: ArgumentError: 2×2 LazyBandedMatrices.Bidiagonal{Float64, Vector{Float64}, Vector{Float64}}:
 diag: 1.0  2.0
 sub: 3.0 is lower-bidiagonal
Stacktrace:
 [1] supdiagonaldata(D::LazyBandedMatrices.Bidiagonal{Float64, Vector{Float64}, Vector{Float64}})
   @ LazyBandedMatrices C:\Users\djv23\.julia\packages\LazyBandedMatrices\aQCdj\src\bidiag.jl:444
 [2] top-level scope
   @ REPL[17]:1

but for larger matrices it just prints a lot of unnecessary content. Where I encountered this was when accidentally using this method with an infinite matrix,

julia> using ClassicalOrthogonalPolynomials, ArrayLayouts

julia> R = Jacobi(1, 0) \ Jacobi(0, 0);

julia> ArrayLayouts.subdiagonaldata(R)
ERROR: OutOfMemoryError()
Stacktrace:
  [1] GenericMemory
    @ .\boot.jl:516 [inlined]
  [2] Array
    @ .\boot.jl:578 [inlined]
  [3] vcat(::UnitRange{Int64}, ::UnitRange{Int64})
    @ Base .\range.jl:1357
  [4] _print_matrix(io::IOBuffer, X::AbstractVecOrMat, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64, rowsA::UnitRange{…}, colsA::InfiniteArrays.InfUnitRange{…})
    @ Base .\arrayshow.jl:203
  [5] print_matrix(io::IOBuffer, X::LinearAlgebra.Adjoint{…}, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64)
    @ Base .\arrayshow.jl:171
  [6] print_matrix
    @ .\arrayshow.jl:171 [inlined]
  [7] show(io::IOBuffer, M::LazyBandedMatrices.Bidiagonal{…})
    @ LazyBandedMatrices C:\Users\djv23\.julia\packages\LazyBandedMatrices\aQCdj\src\bidiag.jl:201
  [8] print(io::IOBuffer, x::LazyBandedMatrices.Bidiagonal{…})
    @ Base .\strings\io.jl:35
  [9] print_to_string(::LazyBandedMatrices.Bidiagonal{…}, ::Vararg{…})
    @ Base .\strings\io.jl:148
 [10] string
    @ .\strings\io.jl:189 [inlined]
 [11] subdiagonaldata(D::LazyBandedMatrices.Bidiagonal{Float64, LazyArrays.BroadcastVector{…}, LazyArrays.BroadcastVector{…}})
    @ LazyBandedMatrices C:\Users\djv23\.julia\packages\LazyBandedMatrices\aQCdj\src\bidiag.jl:445
 [12] top-level scope
    @ REPL[21]:1
Some type information was truncated. Use `show(err)` to see complete types.

which took a minute to debug initially since it hides the intended error

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.26%. Comparing base (f6b5f1c) to head (ea89981).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
+ Coverage   84.85%   85.26%   +0.40%     
==========================================
  Files           7        7              
  Lines        1301     1323      +22     
==========================================
+ Hits         1104     1128      +24     
+ Misses        197      195       -2     

☔ View full report in Codecov by Sentry.
📢 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.

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