-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Fixed bug computing categorical datashader aggregates #2295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the problem I was having; thanks!
Now added tests, ready to merge once passing. |
I've also pushed a fix for #2299 to this PR and added a unit test. |
holoviews/operation/datashader.py
Outdated
if isinstance(agg_fn, ds.count_cat): | ||
name = '%s Count' % agg_fn.column | ||
vdims = [dims[0](column)] | ||
name = '%s Count' % column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = ('%s Count' % column) if isinstance(agg_fn, ds.count_cat) else column
?
Personally, I don't like it when I see simple variable reassignments e.g x=y
used in this way. Up to you, I won't hold the merge up because of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is more to the if/else block than just this single line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose I see what you're getting at.
Happy to merge once you reply to my comment. I won't hold up the merge if you don't want to make the suggested change. |
Made the change, ready to merge once tests pass again. |
Tests are passing. Merging. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Recently I added some validation to xarray Datasets that disallows coords (kdims) and data variables (vdims) with the same name, which was apparently being used by the datashader
aggregate
operation for categorical aggregates. This handles them correctly.