Skip to content

Conversation

@mhucka
Copy link
Collaborator

@mhucka mhucka commented Sep 6, 2025

This removes unused imports across many files. The approach taken was to get a list of the unused imports using

flake8 recirq --exclude recirq/third_party --select F401

and then fixing the cases that it listed.

This removes unused imports across many files.
@mhucka mhucka changed the title Fix: remove unused imports Fix #433: remove unused imports Sep 6, 2025
@mhucka mhucka marked this pull request as ready for review September 6, 2025 04:25
from matplotlib import pyplot as plt

# this is for older systems with matplotlib <3.2 otherwise 3d projections fail
from mpl_toolkits import mplot3d # pylint: disable=unused-import
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would not remove this. As per the comment, this is needed for 3d matplotlib graphs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I must admit I was going by the comments about the problem being in matplotlib versions before 3.2. ReCirq itself does not pin the matplotlib version, and since 3.2 released in 2020, I guess I made the assumption that people who import seaborn (from the top-level requirements.txt file) would get a matplotlib version newer than 3.2. (Seaborn requires matplotlib > 3.4.)

Anyway, I'll remove this change, because it's not essential anyway and surely not worth spending more time on …

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, not sure how relevant it still is, but it's really annoying to figure out and debug when it (used to?) happens, so it's worth it just to keep it for now.

@mhucka mhucka merged commit 63afb7a into quantumlib:master Sep 19, 2025
11 checks passed
@mhucka mhucka deleted the mh-remove-unused-imports branch September 19, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants