-
-
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
Various Optimizations #359
Conversation
3f02d8f
to
fda86cb
Compare
if len(labels) == 1: | ||
return list(labels)[0] | ||
if len(self): | ||
return next(itervalues(self.data)).label |
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.
I think you still need to check _auxiliary_component
as that marks Annotations
where you don't want to propagate the label upwards.
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.
Bottom layer should usually not be an annotation but I can just throw a while loop in there that'll iterate until it finds a non-auxiliar component.
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.
My understanding is that label should be the empty string if the first value (i.e the one we are inspecting) is an _auxiliary_component
. Before we were iterating over the NdMapping elements: when you say the bottom layer shouldn't be an annotation, I believe you are thinking about Overlay elements. In other words, I think we need this check for HoloMaps of annotations.
fda86cb
to
1c330be
Compare
One quick comment: the code looks good but seems to repeat itself (almost exactly, but not quite) between group and label. I would consider a utility or this, either a function with an option to get the group or label, or maybe a class with two classmethods Otherwise it looks good and I am happy to merge. |
2f59211
to
f2e6931
Compare
Looks good once the tests are passing. One thing you didn't mention at the start of the PR was how slow the old label/group processing was. I know this will offer some sort of performance improvement but I don't have a feeling for what kind of speed up I can expect and in which situations. |
This PR is ready for merge now that the tests are passing. |
For very nested datastructures it saves a lot of time. I tested it on plotting a HoloMap of 1000 Overlays each containing 100 Curves, in that example it saved 120/130 seconds. |
Thanks. That is a plausible holomap and 120 seconds is a significant saving - although you didn't say how long it took in total. :-) Edit: Philipp tells me it saved 120 seconds from 130 seconds. A huge improvement indeed! |
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. |
This is a PR for various optimizations on some of the core components of HoloViews.