-
Notifications
You must be signed in to change notification settings - Fork 34
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
CategoricalArray creation #333
Comments
Damn. Issues will never stop popping up... There are only two solutions to this:
The second one would require fewer changes, but in the case of |
Note that currently is super upredictable:
I think we have to go for option 2., as I assume you do not like option 1. very much (and require users to explicitly opt-in for a vector to be categorical after transformation). |
That failure is indeed not super justified, as the ordering is perfectly well defined. I think we already have all the logic in place to check whether the result can be ordered or not. IIRC when we added this error, we considered an alternative which was to add a separate property indicating that levels should be "locked", which could be applied both to ordered and unordered arrays. That would still throw an error in the original example... but at least you'd have opted in for trouble. :-)
Well opt-in wouldn't be too bad if at least it could be efficient. But if things like |
I think we should ensure that generic code like This in particular means that I think we should allow merging even two ordered |
@alyst IIRC you advocated in favor of throwing an error when trying to implicitly add levels to an ordered |
I can say that even I advocated it in the past, but we need to make |
My issue (#84, wow, quite some time has passed) was about being able to declare the levels at the categorical array creation time. |
OK, thanks. So I guess we can stop throwing an error, and just mark the pool as unordered if levels don't have compatible orders (the code to check this is already in place). For reference, the error was added at #125 (Cc: @gustafsson but I'm not sure he's still working on Julia). Adding a |
This is problematic:
The text was updated successfully, but these errors were encountered: