| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
👍 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
Sorry, something went wrong.
|
Good catch! We should have a bit of a think about what to do about pyplot.annoate though... |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
>>> plt.annotate(s="hi", xy=(0,0), xytext=(1,1)) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: annotate() missing 1 required positional argument: 'text' >>> plt.gca().annotate(s="hi", xy=(0,0), xytext=(1,1)) __main__:1: MatplotlibDeprecationWarning: The 's' parameter of annotate() has been renamed 'text' since Matplotlib 3.1; support for the old name will be dropped in 3.3. Text(1, 1, 'hi') With this patch applied, passing an explicit s kwarg to pyplot.annotate does cause a TypeError. |
Sorry, something went wrong.
|
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)). |
Sorry, something went wrong.
|
I'm willing to implement at least the stopgap mentioned by @anntzer, if that is what we want for now |
Sorry, something went wrong.
|
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) |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
Technically this breaks plt.annotate(s=...) without a deprecation, and the fix would be to merge #15254. If we decide to ignore the APi break, I agree (some version of) this should go in ASAP. |
Sorry, something went wrong.
|
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) |
Sorry, something went wrong.
|
Closing and opening to rerun CI. |
Sorry, something went wrong.
|
Rebased on top of master after #15254 was merged |
Sorry, something went wrong.
There was a problem hiding this comment.
Please add a test of the warning.
Sorry, something went wrong.
There was a problem hiding this comment.
modulo fixing the location of the api_changes.
Sorry, something went wrong.
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
|
Rebased on top of master to avoid merge conflict |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Annotate.__init__ changed it's signature in #13128, however it did not
change 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