JuliaIO / Zarr.jl

Other
119 stars 24 forks source link

Would it be difficult to add support for using symbols as keys to ZArray? #128

Open alex-s-gardner opened 10 months ago

alex-s-gardner commented 10 months ago

Working with DataFrames, I've become accustomed to using symbols for keys and I'm wondering if it's trivial to add support for this in Zarr?

e.g. z = zopen(path2zarr); z[:var_name]

meggart commented 10 months ago

Would not be difficult at all. Here is the getindex implementation for a ZGroup https://github.com/JuliaIO/Zarr.jl/blob/cbcaeadf9d93ec174b850d90ee6db438d962f140/src/ZGroup.jl#L69-L77 , we could either add a method for k::Symbol or justv convert the keys to Strings in general.

meggart commented 10 months ago

A PR would be great.

alex-s-gardner commented 10 months ago

130