-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling CategoricalValue types? #117
Comments
i haven't been able to fix everything due to slight inconsistencies between PooledDataArrays and CategoricalArrays behavior. See JuliaData/CategoricalArrays.jl#117 for details. Working towards a fix for GiovineItalia#1065
Yes, indexing of
Do you have some specific examples that are broken when updating to |
Yes, initializing using a CategoricalArray here leads to breakage on this line: when attempting to call the following functions: This worked fine when we used PooledDataArrays and broke when I replaced the PooledDataArray constructor with the CategoricalArray constructor. This is pretty common throughout Gadfly's code, because before everything was always unwrapped. |
Indeed that's expected. Why does Gadfly use |
@tlnagy I suppose the minimal change would be to use something like |
TBH, I'm not sure. It seems like |
What would happen if you stopped using it? How many bytes uses a single entry in these arrays? |
I think the use of PooledDataArray in Gadfly was less about saving space and more about ordering levels. At some point it may have also been used to distinguish categorical from continuous data, but I'm not sure if that's still the case. |
If that's for ordering, then indeed categorical arrays are still needed. Then the code should just be adapted to accept |
Why do we need this wrapping? It makes is so much harder to user for end users. An operation such as |
It's needed so that |
Ok |
I'm in the process of updating Gadfly's code to use the new DataFrames v0.11+ infrastructure and I'm getting hung up on the
eltype
of CategoricalArrays. It looks accessing an element is always wrapped? I believe this is different from PooledDataArrays?CategoricalArrays
DataArrays v0.6.2
Unfortunately this means that general functions like
something(color::Color)
won't work with CategoricalArrays any more.The text was updated successfully, but these errors were encountered: