Skip to content

Fix rubberbanding on wx+py3.10. #21990

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

Merged
merged 1 commit into from
Dec 17, 2021
Merged

Fix rubberbanding on wx+py3.10. #21990

merged 1 commit into from
Dec 17, 2021

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 17, 2021

Locally (Arch standard packages), it otherwise fails with

File "/usr/lib/python3.10/site-packages/wx/core.py", line 1098, in _DC_DrawLineList
return self._DrawLineList(lines, pens, [])
TypeError: 'numpy.float64' object cannot be interpreted as an integer

Likely the same root cause as #19395.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@anntzer anntzer added this to the v3.5.2 milestone Dec 17, 2021
@anntzer
Copy link
Contributor Author

anntzer commented Dec 17, 2021

Added a minimal smoketest for draw_rubberband.

Locally (Arch standard packages), it otherwise fails with

  File "/usr/lib/python3.10/site-packages/wx/core.py", line 1098, in _DC_DrawLineList
    return self._DrawLineList(lines, pens, [])
TypeError: 'numpy.float64' object cannot be interpreted as an integer
@@ -128,6 +128,8 @@ def check_alt_backend(alt_backend):
"matplotlib.backends.backend_{}".format(backend))

ax.plot([0, 1], [2, 3])
if fig.canvas.toolbar: # i.e toolbar2.
fig.canvas.toolbar.draw_rubberband(None, 1., 1, 2., 2)
Copy link
Member

Choose a reason for hiding this comment

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

codecov claims this line isn't being tested - is that a CI issue or is the if statement never being executed anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least locally, I can confirm that this is indeed executed...

Copy link
Member

Choose a reason for hiding this comment

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

This line is run for all backends, and we skip a few, so it seems to be referring to that.

@QuLogic QuLogic merged commit 0b43f2f into matplotlib:main Dec 17, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 17, 2021
@anntzer anntzer deleted the wxband branch December 17, 2021 23:11
QuLogic added a commit that referenced this pull request Dec 18, 2021
…990-on-v3.5.x

Backport PR #21990 on branch v3.5.x (Fix rubberbanding on wx+py3.10.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants