Cleanup: unused imports, encoding docstring/assert, Docker diffusers pin - #409
Merged
Conversation
- media_to_bytes docstring claimed PNG/AVI and 'image/png'/'video/avi'; the code JPEG-encodes images and MP4-encodes video. Corrected. - video_to_bytes used 'assert video.max() <= 1.0' for input validation, which is stripped under python -O; replaced with a ValueError. - Dockerfile installed diffusers from git master on top of the pinned diffusers==0.36.0, so Docker validators ran a different diffusers than bare-metal (install.sh) and the lockfile. Dropped the git override; 0.36.0 is already installed via 'uv pip install -e .'. Janus and CLIP stay on git (not available as suitable PyPI releases).
- ruff --fix removed 64 unused imports across gas/ and neurons/ module bodies (no behavior change; F401). - The four package __init__.py files re-export public API but had no __all__, so those imports read as 'unused'. Added explicit __all__ lists (verified against F822) — documents the public surface and lets ruff's default rules run clean. Also deleted untracked working-tree litter (cli.py copy, #VEr#, verification_ideass.txt, pr_description.md, stale emacs autosave).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A batch of low-risk cleanups from the remaining correctness/hygiene items. No behavior change in normal operation.
ruff --fixremoved 67 unused imports acrossgas/,neurons/, andtests/(F401). The four package__init__.pyfiles re-export public API but lacked__all__, so their imports read as unused; added explicit__all__lists (verified against F822) rather than deleting the re-exports.encoding.py—media_to_bytesdocstring claimed PNG/AVI output andimage/png/video/avimime types; the code JPEG-encodes images and MP4-encodes video. Corrected. Also replaced anassertused for input validation (stripped underpython -O) with aValueError.diffusersfrom git master on top of the pinneddiffusers==0.36.0, so Docker images ran a different diffusers than bare-metal installs and the lockfile. Dropped the git override (0.36.0 is already installed via the package). Janus and CLIP stay on git — they aren't available as suitable PyPI releases.Not included
The
content_manager.pytab→space reformat is deferred to its ownstyle:PR — ruff-format produces an ~1800-line diff and needs a.git-blame-ignore-revsentry, so it doesn't belong mixed in here.Test plan
pytest tests/— 37 passedruff check(E9/F-series) — clean🤖 Generated with Claude Code