Skip to content

Add reshape method for axes to deal with OffsetArrays' type piracy #123

@jonniedie

Description

@jonniedie
julia> using ComponentArrays, OffsetArrays

julia> ca = ComponentArray(a=1, b=2, c=[3, 4], d=(a=[5, 6, 7], b=8));

julia> reshape(collect(ca), axes(ca))
8-element OffsetArray(::Vector{Int64}, 1:8) with eltype Int64 with indices 1:8:
 1
 2
 3
 4
 5
 6
 7
 8

julia> @which reshape(collect(ca), axes(ca))
reshape(A::AbstractArray, inds::Tuple{Union{Colon, Integer, AbstractUnitRange}, Vararg{Union{Colon, Integer, AbstractUnitRange}}}) in OffsetArrays at C:\Users\jdiegelm\.julia\packages\OffsetArrays\I5Pfg\src\OffsetArrays.jl:345

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