StructArrays.jl icon indicating copy to clipboard operation
StructArrays.jl copied to clipboard

Feature request: Base.empty and Base.emptymutable

Open rakhusur opened this issue 1 year ago • 4 comments

Some generic functions, like in SplitApplyCombine.jl, construct their return values from Base.empty or Base.emptymutable. It would be nice if these were implemented for StructArrays to not always end up with Arrays of Structs.

rakhusur avatar Nov 14 '23 15:11 rakhusur

Not to discourage adding such methods here, but: Assuming you are talking about functions SplitApplyCombine.group and SplitApplyCombine.innerjoin, try FlexiGroups.jl and FlexiJoins.jl respectively. They do better in preserving container types and also often are more performant. These Flexi* packages were actually born because I found SplitApplyCombine not general enough for my usecases.

aplavin avatar Nov 21 '23 15:11 aplavin

Thanks for the tip (and for writing these packages!), I will try them out :).

rakhusur avatar Nov 22 '23 11:11 rakhusur

The empty methods should work out of the box with https://github.com/JuliaLang/julia/pull/49958. There should not need to be extended here

jishnub avatar Dec 14 '23 17:12 jishnub

See also #238

jishnub avatar Dec 15 '23 05:12 jishnub