Skip to content

Commit

Permalink
Merge pull request #246 from JuliaComputing/pv/structarrays
Browse files Browse the repository at this point in the history
Iterate named tuples in mapslices
  • Loading branch information
Pietro Vertechi authored Apr 25, 2019
2 parents 19a758c + 44b3138 commit d905060
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flatten.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function mapslices(f, x::NDSparse, dims; name = nothing)
iterdims = setdiff([1:ndims(x);], map(d->fieldindex(columns(x.index),d), dims))
idx = Any[Colon() for v in columns(x.index)]

iter = Columns(astuple(columns(x.index))[[iterdims...]])
iter = Columns(getsubfields(columns(x.index), [iterdims...]))
if !isempty(dims) || !issorted(iter)
iter = sort(iter)
end
Expand Down

0 comments on commit d905060

Please sign in to comment.