@@ -54,7 +54,8 @@ function ComponentArray(data, ax::AbstractAxis...)
5454 part_axs = filter_by_type (PartitionedAxis, ax... )
5555 part_data = partition (data, size .(part_axs)... )
5656 axs = Axis .(ax)
57- return LazyArray (ComponentArray (x, axs) for x in part_data)
57+ # return [ComponentArray(x, axs...) for x in part_data]
58+ return LazyArray (ComponentArray (x, axs... ) for x in part_data)
5859end
5960
6061# Entry from NamedTuple, Dict, or kwargs
@@ -184,9 +185,10 @@ function make_idx(data, x::AbstractArray, last_val)
184185 out = last_index (last_val) .+ (1 : length (x))
185186 return (data, ViewAxis (out, ShapedAxis (size (x))))
186187end
187- function make_idx (data, x:: A , last_val) where {A<: AbstractArray{<:Union{NamedTuple, ComponentArray }} }
188+ function make_idx (data, x:: A , last_val) where {A<: AbstractArray{<:Union{NamedTuple, AbstractArray }} }
188189 len = recursive_length (x)
189- if eltype (x) |> isconcretetype
190+ elem_len = len ÷ length (x)
191+ if eltype (x) |> isconcretetype && all (elem -> recursive_length (elem) == elem_len, x)
190192 out = ()
191193 for elem in x
192194 _, out = make_idx (data, elem, last_val)
@@ -196,18 +198,18 @@ function make_idx(data, x::A, last_val) where {A<:AbstractArray{<:Union{NamedTup
196198 ViewAxis (
197199 last_index (last_val) .+ (1 : len),
198200 PartitionedAxis (
199- len ÷ length (x) ,
200- indexmap (out)
201+ elem_len ,
202+ indexmap (out),
201203 )
202204 )
203205 )
204206 else
205- error (" Only homogeneous arrays of inner ComponentArrays are allowed." )
207+ error (" Only homogeneous arrays are allowed." )
206208 end
207209end
208- function make_idx (data, x:: A , last_val) where {A<: AbstractArray{<:AbstractArray} }
209- error (" ComponentArrays cannot currently contain arrays of arrays as elements. This one contains: \n $x \n " )
210- end
210+ # function make_idx(data, x::A, last_val) where {A<:AbstractArray{<:AbstractArray}}
211+ # error("ComponentArrays cannot currently contain arrays of arrays as elements. This one contains: \n $x\n")
212+ # end
211213
212214
213215# TODO : Make all internal function names start with underscores
0 commit comments