Skip to content

Error with indexes like S[SphericalCoordinate(0.1,0.2), 1:2:end] #88

@DanielVandH

Description

@DanielVandH
julia> using HarmonicOrthogonalPolynomials

julia> S[SphericalCoordinate(0.1,0.2), 1:2:end]
ERROR: MethodError: no method matching findblock(::BlockArrays.BlockedOneTo{Int64, RangeCumsum{…}}, ::Infinities.RealInfinity)
The function `findblock` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  findblock(::BlockArrays.AbstractBlockedUnitRange, ::Integer)
   @ BlockArrays C:\Users\djv23\.julia\packages\BlockArrays\VccC2\src\blockaxis.jl:407
  findblock(::AbstractUnitRange{<:Integer}, ::Integer)
   @ BlockArrays C:\Users\djv23\.julia\packages\BlockArrays\VccC2\src\blockaxis.jl:440

Stacktrace:
 [1] getindex(P::SphericalHarmonic{…}, xy::SphericalCoordinate{…}, jr::InfiniteArrays.InfStepRange{…})
   @ HarmonicOrthogonalPolynomials C:\Users\djv23\.julia\packages\HarmonicOrthogonalPolynomials\yHaVS\src\multivariateops.jl:38
 [2] top-level scope
   @ REPL[479]:1
Some type information was truncated. Use `show(err)` to see complete types.

The getindex method that is being used is

getindex(P::MultivariateOrthogonalPolynomial{D}, xy::StaticVector{D}, jr::AbstractVector{<:Integer}) where D = P[xy, Block.(OneTo(Int(findblock(axes(P,2), maximum(jr)))))][jr]

Any idea how to fix this? I tried looking into how other methods do it e.g. how 1:2:end is handled for semiclassical Jacobi polynomials, but all the getindex code buried in layout_getindex gets me confused fast. Not too urgent since I can get around it with view for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions