Skip to content

Remove unused Python imports and dependencies - #896

Merged
MakisH merged 3 commits into
precice:developfrom
floze-the-genius:cleanup-833-unused-python-deps
Aug 14, 2026
Merged

Remove unused Python imports and dependencies#896
MakisH merged 3 commits into
precice:developfrom
floze-the-genius:cleanup-833-unused-python-deps

Conversation

@floze-the-genius

@floze-the-genius floze-the-genius commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove unused Python imports across tutorial participants and test tooling
  • drop matplotlib and numpy from the two participants that no longer use them
  • regenerate the affected reference requirements with the repository tool
  • preserve the Axes3D side-effect import needed by supported Matplotlib versions before 3.2

Testing

  • uvx ruff check . --select F401
  • compile every changed Python file with python3 -m py_compile
  • run the autopep8 and size pre-commit hooks on the changed files
  • run print_metadata.py, print_test_suites.py, and systemtests.py --help
  • check both updated reference requirements with --check --fail-on-outdated

The repository-wide check-names hook also ran, but reports pre-existing permalink errors in unchanged README files.

Checklist

  • Added changelog-entries/896.md
  • Regenerated sibling requirements-reference.txt files for changed requirements

Fixes #833

@MakisH MakisH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the contribution! I guess that #833 is now sufficiently addressed.

The system tests pass, and I looked over all files, I don't see anything wrong: all removed imports are not mentioned anywhere in the file.

The repository-wide check-names hook also ran, but reports pre-existing permalink errors in unchanged README files.

Where do you see that? check-names passes on the CI.

It would be useful to have such a check for unused imports as a pre-commit hook.

import sys
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 - registers projection='3d' on Matplotlib <3.2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would argue that matplotlib 3.2 is already too old, but we don't have version restrictions for this script yet, so that's all good for now.

@MakisH MakisH self-assigned this Aug 14, 2026
@MakisH
MakisH merged commit 4d6d386 into precice:develop Aug 14, 2026
2 checks passed
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.

Check for unused Python dependencies

2 participants