Skip to content

a bug fix for the general ragged array #112

@kazuakiyama

Description

@kazuakiyama

Thanks a lot for developing this package! I want to use Zarr's ragged arrays for some tables that contain multi-dimensional arrays as elements, and I encounter some issues when I try to form a ragged array of two or higher-dimensional arrays. The issue happens when you run a code like the following.

using Zarr

arr = zcreate(Array{Float64, 2}, 10)
arr[:] .= [zeros(Float64,2,2) for i in 1:10]

This will give an error because of the lack of the _zero method for general multidimensional arrays around line 133 of ZArray.jl. I guess adding a line something like

_zero(::Type{<:Array{T, N}}) where T where N = zeros(T, zeros(Int, N)...)

will fix the issue as I think we can follow what has already been defined for Vector{T}. I really appreciate it if you can fix this problem as it is probably easily fixable. Thanks!

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