rafaqz / DimensionalData.jl

Named dimensions and indexing for julia arrays and other data
https://rafaqz.github.io/DimensionalData.jl/stable/
MIT License
262 stars 38 forks source link

extend CategoricalArrays #716

Closed tiemvanderdeure closed 1 month ago

tiemvanderdeure commented 1 month ago

Extend CategoricalArrays, so categorical(x::DimArray) returns a DimArray with categorical values, and common (documented) operations on categorical arrays work on such categorical DimArrays.

rafaqz commented 1 month ago

Thanks! Good to have

For my understanding is there a reason these things don't "just work" already? Does CategoricalArrays.jl not use similar or not accept AbstractArray ?

tiemvanderdeure commented 1 month ago

They don't work already. categorical errors due to an ambiguous dispatch of copyto!, cut does not error but returns a CategoricalArray (without dimensions). All of the other methods dispatch on CategoricalArray.

rafaqz commented 1 month ago

Ah right, they haven't written it to be extensible at all.