moved cla shared axes code to a dedicated function#8710
moved cla shared axes code to a dedicated function#8710jrmlhermitte wants to merge 2 commits intomatplotlib:masterfrom jrmlhermitte:cla-shared
Conversation
|
I would something like (where |
|
I think there is a much simpler way to eliminate most of the duplication that this PR is targeting. The problem is in the calls to the # self.xaxis._set_scale(self._sharex.xaxis.get_scale())
self.xaxis._scale = mscale.scale_factory(self._sharex.xaxis.get_scale(), self.xaxis)then the saving and restoring could be deleted, saving 16 lines of code. |
|
Overridden by #8720. |
|
thanks for letting me know. I apologize, I have been extremely busy with other things. I'm glad this got sorted out :-) |
PR Summary
Response to the end of #8455 with discussion with @WeatherGod
The goal of this PR is to clean up the code in
Axes.cla(), which has grown to be large. We probably want something clean over something quick here. This is meant to be a very simple aesthetic change, nothing more (no logic changes).PR Checklist
PR Details
This is also just a suggestion, and there likely may be a better way. I am opening it so it does not get lost. I am open to suggestions, and if you have something nicer, feel free to create a new PR (but please reference this one so we don't get lost).
However, I believe it does bring some points of discussion that I think may be necessary to address, such as:
clais overridden, then_cla_sharedneeds to be also removed from the class (i.e. for polar axes). Right now this would have to be manually done. I am wondering if there exist decorators implemented that take care of these? For example:where
@cla.overridewould contain the necessary bookeeping to remove_cla_sharedwhenclais overridden. I will try to search more when I have time but if someone has insight I'm interested to know (and thanks for saving me time :-) ). @QuLogic might have some idea and some input with his experience with polaraxes.test/test_axes.pycontain a long list of failures (which seem to be the same with and without this change).thanks!