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

MNT: Remove unused imports#23554

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
anntzer merged 4 commits intomatplotlib:mainfromoscargus:unusedimports
Aug 18, 2022
Merged

Conversation

oscargus
Copy link
Member

PR Summary

Found some unused imports.

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (andpytest passes).
  • [N/A] IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [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).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@QuLogic
Copy link
Member

It looks like this is caused bythis blanket exception; perhaps that can be removed now?

@oscargus
Copy link
MemberAuthor

It looks like this is caused bythis blanket exception; perhaps that can be removed now?

There are still unused imports in backends, but ones that I believe are required, like the FigureManagers etc. I guess one can mark the lines, which I am strongly in favour of instead of the file, but it will take some time...

@anntzer
Copy link
Contributor

Perhaps you can remove F401 for all backends from.flake8 (and put in a more targeted exclusion if needed)?

@oscargus
Copy link
MemberAuthor

New change where I started to use__all__, which seems like it hasn't been used earlier. For some files it is a bit of a hassle, so I selected the relatively easy ones.

There is a minor risk for breakage. For example, it is in current main possible to import numpy as:

from matplotlib.tri import np

This is no longer possible after this change.

@@ -46,7 +46,7 @@
import matplotlib.axes as maxes
from matplotlib.path import Path
from mpl_toolkits.axes_grid1 import mpl_axes
from .axisline_style import AxislineStyle
from .axisline_style import AxislineStyle # noqa
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Maybe one should deprecate this? Not sure if someone is actually importing it from here?

@oscargusoscargus marked this pull request as draftAugust 4, 2022 21:43
@oscargus
Copy link
MemberAuthor

Converting to draft until I have had time to think about thetri documentation issue.

@QuLogicQuLogic self-requested a reviewAugust 4, 2022 21:50
@oscargusoscargus marked this pull request as ready for reviewAugust 5, 2022 13:03
@tacaswelltacaswell added this to thev3.6.0 milestoneAug 5, 2022
@oscargusoscargus mentioned this pull requestAug 5, 2022
2 tasks
@anntzeranntzer merged commit23100c4 intomatplotlib:mainAug 18, 2022
@oscargusoscargus deleted the unusedimports branchAugust 18, 2022 20:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@anntzeranntzeranntzer approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

4 participants
@oscargus@QuLogic@anntzer@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp