| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Both these classes have called their own .cla() method in their .__init__() method, so don't call it again in Axes.cla() if doing Axes.__init__().
If the Axis was just created, calling Axis.cla is redundant because it just happened.
|
It turns out that subclasses (like PolarAxes) tend to override their cla method, so changing their signature is dangerous. Instead, I added an attribute that indicates that the class is still in its __init__ phase. I'm not sure if the same is true of Spine.register_axis, but seen an error and thus haven't changed it back. |
Sorry, something went wrong.
|
This seems awkward. Couldn't we take advantage of self.stale instead? |
Sorry, something went wrong.
|
I don't see how. If you mean use it directly, it doesn't hold the same information as what we need. The added flag indicates (essentially) "no settings have been changed from the default", but self.stale means "current settings are different from what was drawn". It has no relationship with default settings for us to use. If you mean, write something similar to self.stale, that's a lot of work for very little gain and seems rather non-trivial and error-prone to me. |
Sorry, something went wrong.
|
I'm starting to think that the approach to reducing the redundant cla calls here is better than the way I did it in #8752. If so, we should merge this (or a modification of it) and I can change #8752 accordingly. (It needs some more work, but I still want to get that one in, too.) |
Sorry, something went wrong.
There was a problem hiding this comment.
I think this looks like a clean and minimally-invasive solution to a long-standing problem.
Sorry, something went wrong.
|
This appears to have broken lots of stuff on travis! https://travis-ci.org/matplotlib/matplotlib/builds/298909059 I'm going to revert, @QuLogic could you re-open the PR so we can run the changes against the latest revision of master? |
Sorry, something went wrong.
|
This reminds me all kind of strange fails I had faced a year ago at fixing the particular problem. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
As noted in #6664, Axes.__init__ is fairly slow due to the eventual call to Axis.reset_ticks. @efiring suggested lazy instantiation and @Kojoley was implementing, but I'm unsure of the status. In the meantime though, we still speed things up by avoiding calling cla too many times.
Using the example from #6664 with v2.0.x:
and master is already a bit faster:
The trouble with Axes.__init__ is that it does a bit too much clearing; Axes.__init__ calls:
That makes 12 calls to Axis.cla for only 2 Axis objects. Adding some hidden argument to skip these calls as in this PR would reduce those calls by 6, though the speedup is only approximately 4 times:
PR Checklist