Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 3 commits intomatplotlib:masterfromksunden:annotate_argument
Mar 26, 2020

Conversation

ksunden
Copy link
Member

@ksundenksunden commentedAug 13, 2019
edited by dopplershift
Loading

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

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@tacaswelltacaswell added this to thev3.2.0 milestoneAug 13, 2019
tacaswell
tacaswell previously requested changesAug 13, 2019
Copy link
Member

@tacaswelltacaswell left a 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 tohttps://github.com/matplotlib/matplotlib/tree/master/doc/api/next_api_changes

@tacaswell
Copy link
Member

Good catch!

We should have a bit of a think about what to do about pyplot.annoate though...

@anntzer
Copy link
Contributor

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.

anntzer
anntzer previously approved these changesAug 13, 2019
@ksunden
Copy link
MemberAuthor

>>> 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 explicits kwarg topyplot.annotate does cause aTypeError.
The function is not decorated with the_rename_parameter decorator.

@anntzer
Copy link
Contributor

good catch :/
I guess this is another argument in favor of#14130 (comment) (@tacaswell do you want to comment on that?)

if the general problem doesn't get fixed quickly you can always go with manually writing the pyplot wrapper as a stopgap (#14130 (comment)).

@ksunden
Copy link
MemberAuthor

I'm willing to implement at least the stopgap mentioned by@anntzer, if that is what we want for now

@ksunden
Copy link
MemberAuthor

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)

@jklymak
Copy link
Member

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.

@anntzer
Copy link
Contributor

Technically this breaksplt.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.

@ksunden
Copy link
MemberAuthor

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)

@ksunden
Copy link
MemberAuthor

Closing and opening to rerun CI.

@ksundenksunden reopened thisMar 13, 2020
@QuLogicQuLogic linked an issueMar 20, 2020 that may beclosed by this pull request
@ksunden
Copy link
MemberAuthor

Rebased on top of master after#15254 was merged

Copy link
Member

@QuLogicQuLogic left a 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.

Copy link
Contributor

@anntzeranntzer left a 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.

ksundenand others added3 commitsMarch 26, 2020 12:16
Run boilerplate.pychange version rename takes effectCo-Authored-By: Thomas A Caswell <tcaswell@gmail.com>Release note of variable changeRebased onto newer masterAddress doc buildingApply suggested language change for release noteCo-Authored-By: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Flake8Match warning to ensure correct one caught, Update version deprecatedFlake8 whitespaceSimplify test
Remove specification for where the old parameter remains supportedThis was fixed by mergingmatplotlib#15254
@ksunden
Copy link
MemberAuthor

Rebased on top of master to avoid merge conflict

@QuLogicQuLogic merged commita032c6f intomatplotlib:masterMar 26, 2020
@ksundenksunden deleted the annotate_argument branchMarch 26, 2020 22:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm left review comments

@QuLogicQuLogicQuLogic approved these changes

@anntzeranntzeranntzer approved these changes

@tacaswelltacaswelltacaswell left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.3.0
Development

Successfully merging this pull request may close these issues.

small typo in the documentation
6 participants
@ksunden@tacaswell@anntzer@jklymak@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp