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

Raise correct exception out of Spines.__getattr__#21570

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
timhoffm merged 1 commit intomatplotlib:mainfromQuLogic:spine-getattr
Nov 9, 2021

Conversation

QuLogic
Copy link
Member

PR Summary

If the name does not exist, then__getattr__ should raiseAttributeError, notValueError.

Fixes#21554

PR Checklist

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • [n/a] Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • [n/a] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

If the name does not exist, then `__getattr__` should raise`AttributeError`, not `ValueError`.Fixesmatplotlib#21554
@QuLogicQuLogic added this to thev3.4.4 milestoneNov 9, 2021
Copy link
Contributor

@greglucasgreglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good, but I'm not sure this closes the issue though. Now, we'll at least get the right error, but it still isn't a super helpful message for the user.

AttributeError: 'Spines' object does not contain a '__deepcopy__' spine

Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Approve for changing the error type.

It's however not a fix to the reported issue.deepcopy(figure) should not fail on some random internal state. Either we forbid it explicitly or somebody has to make it work with a reasonable meaning.

@timhoffmtimhoffm merged commitb9065f7 intomatplotlib:mainNov 9, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestNov 9, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestNov 9, 2021
@QuLogicQuLogic deleted the spine-getattr branchNovember 9, 2021 20:58
QuLogic added a commit that referenced this pull requestNov 9, 2021
…570-on-v3.5.xBackport PR#21570 on branch v3.5.x (Raise correct exception out of Spines.__getattr__)
QuLogic added a commit that referenced this pull requestNov 10, 2021
…570-on-v3.4.xBackport PR#21570 on branch v3.4.x (Raise correct exception out of Spines.__getattr__)
@QuLogicQuLogic modified the milestones:v3.4.4,v3.5.0Nov 16, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

@greglucasgreglucasgreglucas approved these changes

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

Successfully merging this pull request may close these issues.

[Bug]:ValueError upon deepcopy of aFigure object
3 participants
@QuLogic@timhoffm@greglucas

[8]ページ先頭

©2009-2025 Movatter.jp