-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MNT: make Axes.cla an alias for Axes.clear in all cases #22802
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
MNT: make Axes.cla an alias for Axes.clear in all cases #22802
Conversation
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers
or anyone who has commented on the PR. 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.
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.
Looks like a great start! I think there were a few places that you added in a definition of cla()
into a subclass when it could be inherited from the superclass, so I'd suggest looking at what each of the classes is inheriting from and making sure that there is a cla() in the parent that can get used. Let me know if that doesn't make sense or if I'm mistaken too!
Also, if you want to add your friend as a contributor on the commit, you can use the "co-authored-by" feature in the commit message: https://docs.github.com/en/github-ae@latest/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors
bccc557
to
20f8c8b
Compare
@greglucas Thanks for the feedback and suggestions! I just amended the PR. Summary:
Please let me know if there's anything else I should do! |
71ddfe1
to
c8dd978
Compare
Just pushed our updates. Unfortunately, we accidentally fetched from upstream before pushing and as a result there are some changes (particularly in pyplot) that are from upstream (the root matplotlib repo). Hopefully this is ok - if not, is there any way around this? |
@greglucas Thanks for the feedback and suggestions! When trying to merge my changes to the current commit, I kept running into Failed to Push Refs due to stale info errors as shown here. Then I tried to "fetch the updates from upstream and rebase first" as outlined in this source, which caused the merge from main commit you saw. Anyways, my partner (@lijake8) was able to amend our changes for this PR. Summary:
Please let me know if there's anything else we should revise or do! |
522b9a7
to
f2418bf
Compare
FInally fixed the commits issue with latest updates in accordance with notes above |
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.
Looks good to me! Just two very minor comments here. Then we just need to wait for a second reviewer before merging.
lib/matplotlib/tests/test_figure.py
Outdated
@@ -796,7 +796,6 @@ def test_clf_not_refedined(): | |||
# check that subclasses do not get redefined in our Figure subclasses | |||
assert 'clf' not in klass.__dict__ | |||
|
|||
|
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.
Hm... Is flake8 not getting run on tests? I'm pretty sure this line should be there. This file should also be left alone if you aren't touching it anymore.
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.
Fixed
deafadc
to
bcbe1ca
Compare
bcbe1ca
to
ec95f99
Compare
Thanks @lijake8 and congratulations on your first contribution to Matplotlib! We hope to see you again. |
@timhoffm My partner @lijake8 and I both worked on contributing to this issue together. We also added my name as a co-author to the commit message of our PR as instructed by @greglucas above: Link to Co-Author Confirmation Screenshot: https://drive.google.com/file/d/14Jq8-fY_ZnIRJhUmypprvf4rG7A3Y6xk/view?usp=sharing Can you confirm that both myself @neil-gurnani (Neil Gurnani) and my partner (@lijake8) will be credited for this contribution? Thank you for your guidance with this and your approval of our Pull Request! |
You’ve not followed the format that GitHub defines for co-author attribution. So on the technical side only @lijake8’s account is linked to the PR. OTOH @neil-gurnani your name is in the commit message, which states that you have contributed. |
As Tim said, it looks like the commit message did not trigger the co-author logic in GH. I suspect the issue is that GH is looking for the tags at the end, but you put it in the first line of the commit message (that normally says what it is you did). On one hand I am sympathetic to wanting to get this fixed and get your name listed on GH as a contributor. On the other hand I do not think we want to do a force-push to main to re-write history to fix the commit message (we have force pushed to main in the past but it is my judgement that this does not cross the threshold to do that) and I do not think that adding an empty commit with your name on it is a good option either (it makes it really odd if anyone looks it up later and I think is a bad precedent to set). Given that the concept of co-authoring is a GH concept (rather than a pure git concept), it may be worth reaching out to github support about this. At a minimum they can add a warning to their docs about where the line is searched for. |
PR Summary
We (myself and @neil-gurnani) consolidated all implementations of cla/clear under a clear method (the clear functionality is implemented in clear, and cla calls clear for the sake of minimizing code duplication and improving maintainability). We added 2 tests ensuring subclasses do not override cla. Existing tests for cla were left as-is; since cla calls clear, coverage is not compromised.
Every subclass has both cla and clear, since it was mentioned in #22738 that cla is still too widely used to be fully deprecated as of now. We added appropriate docstrings/comments for all cla/clear methods.
We left all original '_api.deprecated' decorators as-is but did not add any new decorators (please let us know if this is needed).
Finally, please let us know if there's any issue with this PR we should address. This was our first PR and we really enjoyed working on it.
Thanks
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).