GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — Refactoring: Removing axis parameter from scales by vagnermcj · Pull Request #29988 · matplotlib/matplotlib Conversation
Contributor
This PR addresses issue #29349 by refactoring built-in scale classes to make the axis parameter optional. The goal is to support future removal of axis while maintaining backward compatibility with current usage. To achieve this, a decorator was introduced to allow constructors to accept or ignore axis. This was applied across all built-in scales. The scale_factory() function was updated to handle scale classes that do or do not use axis, and register_scale() now issues a deprecation warning if the constructor still expects it. These changes prepare the codebase for eventual deprecation of axis in scale initializers, while avoiding any breaking changes in current usage. My only doubt is which initializers for the scales should have the parameter as "axis = None". If all of them should have it, then i have to change the way my decorator works because axis could change position in parameters index
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
vagnermcj
marked this pull request as draft
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. You can also join us on gitter for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide We strive to be a welcoming and open project. Please follow our Code of Conduct.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
vagnermcj
marked this pull request as ready for review
timhoffm
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the PR. This is a bit tricky to get right in a backward-compatible and migration-easy way. I think we need to do it slightly differently.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
timhoffm
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It does not matter for small PRs. We'll typically review the full diff and squash-merge.
Yes. Sorry my bad for the incorrect suggestion.
You should add a test that the decorated scales can be created with and without axis passed. - Either test on one of the scales, or write an explicit test for the decorator.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Looks like mypy just made a new release, so I suspect we will now see the same linting errors on all PRs. You can ignore them here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please leave out the unrelated typing modifications.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is good, except for one annotation to self.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Do i still need to make some change in the code? I see that it was accepted but some tests are failing It's my first PR so i'm not sure 😅 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We require two reviews from core developers. The second one is still pending. IIRC the test failures were unrelated, but since the test runs have been cleaned up, you could rebase onto main and force-push. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Updated my refactor based on the feedbacks received
Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Tim Hoffmann <[email protected]>
223dc30 to
dabac62
Compare
There was an error while loading. Please reload this page.
Co-authored-by: Elliott Sales de Andrade <[email protected]>
There was an error while loading. Please reload this page.
Co-authored-by: Elliott Sales de Andrade <[email protected]>
|
Thanks @vagnermcj! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.