-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make hexbin much faster #859
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
Conversation
Looks good to me. In the hexbin_extent test, the pdf file size drops to about 4% of the original, the svg file to about 57%. |
Yes -- the filesize difference is dramatic. And notably the memory consumption of ghostscript when rendering the PDF file is much lower. |
Down the road, we should probably put the smaller files in the repository as the baseline images -- but for now it's probably good to keep the old ones to ensure that the new approach works correctly. |
Can we get a writeup in the CHANGELOG or in api_changes.rst on this. A lot of this is going right over my head and I doubt I can grok this anytime soon. |
I generally reserve the CHANGELOG for API changes -- this is merely a behind the scenes change. But how about this?
|
I was more referring to all of the features added to backend_bases.py/_backend_agg.* and such. Is it just me, or could they be useful elsewhere as well? |
@@ -359,6 +366,24 @@ def get_offsets(self): | |||
else: | |||
return self._uniform_offsets | |||
|
|||
def set_offset_position(self, offset_position): | |||
""" | |||
The how offsets are applied. If *offset_position* is 'screen' |
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.
Docstring glitch.
@mdboom, I suggest you fix the docstring and then go ahead and commit. I don't see any point in waiting longer. This is quite an improvement. |
… polygon and a number of offsets. This allows the Agg backend to be dealing with far less data, and it allows the vector backends to write the polygon once and "use" it multiple times.
@WeatherGod: The new setting ("offset_position") is documented in the Collections:get_offset_position/set_offset_position docstrings (improved in the most recent commit), and the new flag to the backend method is documented in RendererBase:draw_path_collection. I've also added a CHANGELOG entry. Assuming that addresses your concerns, I'll go ahead and merge. |
Yes, I think that made things much clearer for me. Thank you. |
By creating a PolygonCollection containing a single polygon and a number of offsets. This allows the Agg backend to be dealing with far less data, and it allows the vector backends to write the polygon once and "use" it multiple times.
@efiring, @astraw, @ddale all seem to have had a hand in hexbin, so may be interested.