-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Annotate argument in axes class match upstream #15049
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
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.
👍 of the change, but can you please add an API change note to https://github.com/matplotlib/matplotlib/tree/master/doc/api/next_api_changes
Good catch! We should have a bit of a think about what to do about pyplot.annoate though... |
there's no problem with pyplot.annotate? it'll be subject to the same deprecation period. it's _make_keyword_only that interacts poorly with pyplot. |
With this patch applied, passing an explicit |
good catch :/ if the general problem doesn't get fixed quickly you can always go with manually writing the pyplot wrapper as a stopgap (#14130 (comment)). |
I'm willing to implement at least the stopgap mentioned by @anntzer, if that is what we want for now |
I was just reminded of this, I've seen some PRs in recent days/weeks regarding annotate and some of the renaming of params and such, but did not track them closely enough to see if they were fixing this problem in another way, enabling this PR to work as intended, or just actually unrelated to this change entirely. So, just checking in, seeing if there is anything that needs to be done to this PR to catch up (it appears to me that the docstring and the method signature are still mismatched as of now) |
There are no merge conflicts, so thats usually a good sign that no one has touched the section of the code you have touched. OTOH, you have some documentation failures, and should rebase with master to make sure all the CI is using recent CI. |
Technically this breaks |
e904c07
to
8417223
Compare
CI Failure looks unrelated to me... (Looks like two image files just failed to write properly, nothing to do with the actual code difference here) I did test out #15254, the change proposed here is still needed (to Axes.annotate), but that PR does prevent the API deprecation problem. (There is a small merge conflict, as both edit pyplot.py, but it is only in the generated portion of that file, anyway) |
Closing and opening to rerun CI. |
ebab7e3
to
ba34a85
Compare
Rebased on top of master after #15254 was merged |
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.
Please add a test of the warning.
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.
modulo fixing the location of the api_changes.
Run boilerplate.py change version rename takes effect Co-Authored-By: Thomas A Caswell <tcaswell@gmail.com> Release note of variable change Rebased onto newer master Address doc building Apply suggested language change for release note Co-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Flake8 Match warning to ensure correct one caught, Update version deprecated Flake8 whitespace Simplify test
Remove specification for where the old parameter remains supported This was fixed by merging matplotlib#15254
6cf8cce
to
cbc65ac
Compare
Rebased on top of master to avoid merge conflict |
PR Summary
Annotate.__init__
changed it's signature in #13128, however it did notchange the python signature of the downstream functions which inherit its docstring, leading to a mismatch between the docstring and the signature.
I wasn't sure which version should have been put in the decorator, so I used the same as the parent, though I would expect to add the minor version, I guess.
Note: this does change pyplot without having a decorator to catch users who pass in the string explicitly by "s"... Not sure how to handle that
There was some debate in #12383 (comment) and #13128 regarding this variable change, that did mention the effects in pyplot, though seemed to indicate that it was acceptable.
PR Checklist