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

removing import that is prone to circular imports#9079

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

Conversation

fariza
Copy link
Member

matplotlib.text was importingmatplotlib.backend_bases.RendererBase without actually using it.

The problem is not that it doesn't use it, the problem is that this import creates a circular import.
The circular import became evident when working on PR#9022 adding
from matplotlib.table import Table tomatplotlib.backend_tools.py gave the following error

  File "histogram_cumulative.py", line 39, in <module>    import matplotlib.pyplot as plt  File "/home/fariza/workspace/matplotlib/lib/matplotlib/pyplot.py", line 29, in <module>    import matplotlib.colorbar  File "/home/fariza/workspace/matplotlib/lib/matplotlib/colorbar.py", line 36, in <module>    import matplotlib.contour as contour  File "/home/fariza/workspace/matplotlib/lib/matplotlib/contour.py", line 22, in <module>    import matplotlib.text as text  File "/home/fariza/workspace/matplotlib/lib/matplotlib/text.py", line 33, in <module>    from matplotlib.backend_bases import RendererBase  File "/home/fariza/workspace/matplotlib/lib/matplotlib/backend_bases.py", line 68, in <module>    import matplotlib.backend_tools as tools  File "/home/fariza/workspace/matplotlib/lib/matplotlib/backend_tools.py", line 16, in <module>    from matplotlib.table import Table  File "/home/fariza/workspace/matplotlib/lib/matplotlib/table.py", line 34, in <module>    from .text import TextImportError: cannot import name 'Text'

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

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

👍 if tests pass

@QuLogicQuLogic merged commitb884161 intomatplotlib:masterAug 23, 2017
@QuLogicQuLogic added this to the2.1 (next point release) milestoneAug 23, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.1
Development

Successfully merging this pull request may close these issues.

3 participants
@fariza@dstansby@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp