{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8710","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8710/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8710/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8710/events","html_url":"https://github.com/matplotlib/matplotlib/pull/8710","id":233381728,"number":8710,"title":"moved cla shared axes code to a dedicated function","user":{"login":"ordirules","id":705366,"avatar_url":"https://avatars1.githubusercontent.com/u/705366?v=3","gravatar_id":"","url":"https://api.github.com/users/ordirules","html_url":"https://github.com/ordirules","followers_url":"https://api.github.com/users/ordirules/followers","following_url":"https://api.github.com/users/ordirules/following{/other_user}","gists_url":"https://api.github.com/users/ordirules/gists{/gist_id}","starred_url":"https://api.github.com/users/ordirules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordirules/subscriptions","organizations_url":"https://api.github.com/users/ordirules/orgs","repos_url":"https://api.github.com/users/ordirules/repos","events_url":"https://api.github.com/users/ordirules/events{/privacy}","received_events_url":"https://api.github.com/users/ordirules/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-03T16:59:53Z","updated_at":"2017-06-03T19:30:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8710","html_url":"https://github.com/matplotlib/matplotlib/pull/8710","diff_url":"https://github.com/matplotlib/matplotlib/pull/8710.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/8710.patch"},"body":"## PR Summary\r\nResponse to the end of #8455 with discussion with @WeatherGod \r\n\r\nThe 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). \r\n\r\n## PR Checklist\r\n\r\n- [x] Has Pytest style unit tests\r\n- [x] Code is PEP 8 compliant \r\n- [ ] New features are documented, with examples if plot related\r\n- [ ] Documentation is sphinx and numpydoc compliant\r\n- [ ] Added an entry to doc/users/whats_new.rst if major new feature\r\n- [ ] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way\r\n\r\n## PR Details\r\nThis 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).\r\n\r\nHowever, I believe it does bring some points of discussion that I think may be necessary to address, such as:\r\n- I think I may be breaking convention (from what I see in code) by having the function take a string and use it to call class methods, but so far it seems to be a cleaner and still readable to me.\r\n- If `cla` is overridden, then `_cla_shared` needs 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:\r\n```python\r\ndef MyNewClass(OldClass):\r\n    @cla.override\r\n    def cla(self):\r\n        #....\r\n```\r\nwhere `@cla.override` would contain the necessary bookeeping to remove `_cla_shared` when `cla` is 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.\r\n- Will need to wait for Travis. My local tests on `test/test_axes.py` contain a long list of failures (which seem to be the same with and without this change).\r\n\r\nthanks!"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/305996422","html_url":"https://github.com/matplotlib/matplotlib/pull/8710#issuecomment-305996422","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8710","id":305996422,"user":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars3.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"created_at":"2017-06-03T19:30:47Z","updated_at":"2017-06-03T19:30:47Z","body":"I would something like\r\n```\r\nfor shared, axis in [(self._sharex, self.xaxis), (self._sharey, self._sharey)]:\r\n    ...\r\n```\r\n(where `get/set_x/ylim` can be written as `axis.get/set_view_interval()` (both are ultimately accessing `ax.viewLim.intervalx/y`)."}}
{"actor":{"display_login":"anntzer"}}