Skip to content

Can AxisVector support push!/pop!/deleteat! ? #232

@Tortar

Description

@Tortar

This seems currently not implemented (by also looking inside the library):

julia> a = AxisArray([1,2,3], [4,5,7])

julia> push!(a, 4, 8) # not sure actually how to do it
ERROR: MethodError: no method matching resize!(::AxisVector{Int64, Vector{Int64}, Tuple{Axis{:row, Vector{Int64}}}}, ::Int64)

Closest candidates are:
  resize!(::BitVector, ::Integer)
   @ Base bitarray.jl:814
  resize!(::Vector, ::Integer)
   @ Base array.jl:1312

Stacktrace:
 [1] _append!(a::AxisVector{Int64, Vector{Int64}, Tuple{Axis{:row, Vector{}}}}, ::Base.HasLength, iter::Tuple{Int64, Int64})
   @ Base ./array.jl:1196
 [2] append!(a::AxisVector{Int64, Vector{Int64}, Tuple{Axis{:row, Vector{Int64}}}}, iter::Tuple{Int64, Int64})
   @ Base ./array.jl:1187
 [3] push!(::AxisVector{Int64, Vector{Int64}, Tuple{Axis{:row, Vector{Int64}}}}, ::Int64, ::Int64)
   @ Base ./array.jl:1188
 [4] top-level scope
   @ REPL[61]:1
Some type information was truncated. Use `show(err)` to see complete types.

Can these methods be supported?

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