Skip to content

Indexing rows using end keyword errors #31

@kahaaga

Description

@kahaaga

Describe the bug

Indexing a state space set with end keyword (e.g. x[1:end, 2:3]) errors. I'd expect this to work. Providing an explicit range (e.g. x[1:n, 2:3] does not error.

Minimal Working Example

julia> x = StateSpaceSet(rand(10, 2))
2-dimensional StateSpaceSet{Float64} with 10 points
 0.29452   0.423066
 0.461336  0.01487
 0.34901   0.568634
 0.225427  0.198393
 0.558053  0.901908
 0.101409  0.74085
 0.670569  0.656894
 0.384735  0.399064
 0.563578  0.54824
 0.176497  0.592265

julia> x[1:end, 2]
ERROR: MethodError: no method matching axes(::StateSpaceSet{2, Float64}, ::Int64)

Closest candidates are:
  axes(::Core.SimpleVector, ::Integer)
   @ Base essentials.jl:784
  axes(::Number, ::Integer)
   @ Base number.jl:83
  axes(::RecurrenceAnalysis.AbstractRecurrenceMatrix, ::Any...)
   @ RecurrenceAnalysis ~/.julia/packages/RecurrenceAnalysis/WMZHE/src/matrices/recurrence_matrix_types.jl:51
  ...

Stacktrace:
 [1] lastindex(a::StateSpaceSet{2, Float64}, d::Int64)
   @ Base ./abstractarray.jl:427
 [2] top-level scope
   @ REPL[15]:1

Package versions

This is on StateSpaceSets v1.5.

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