[ANN] ArraysOfArrays.jl and ShapesOfVariables.jl

@ChrisRackauckas, ShapesOfVariables also contains the “descibe the shape of an array so that another piece of code can instantiate it” functionality we talked about at JuliaCon:

using ShapesOfVariables
shape = ArrayShape{Real}(2, 3)

specifies a 2x3 real-valued array, and

A = Array(undef, shape)

instantiates it. If the element-type of the array shape is abstract (Real, in this example) or a union, ArraysOfArrays will try to find a more-specific type (e.g. Float64, for Real):

typeof(A) == Array{Float64,2}

This default can also be overridden during array construction:

B = Array{Float32}(undef, shape)
typeof(B) == Array{Float32,2}
1 Like