Fix CI: lint, format, vulture, cv2-free test imports - #1
Merged
Merged
Conversation
Three CI jobs were red (none in the simulation core): - lint: ruff style nits across monitor/ and training/sharding.py (X | None, dict vs Dict, unsorted/unused imports). Auto-fixed via `ruff check --fix` + `ruff format`. - test: `ModuleNotFoundError: No module named 'cv2'` — constructing VirtualCL1Server eagerly imported monitor/mjpeg, whose top-level `import cv2` is only needed on the dashboard path. Made the import lazy (inside update_frame) and declared opencv-python in the vizdoom extra so the dashboard still resolves it. - quality: vulture exited 3 on intentionally-unused params (public `colorby` kwarg, context-manager `*exc`, log_message `format` override). Added them to [tool.vulture] ignore_names. Also removed a genuinely dead `neuron_ids` in core/pallas_ops.py and replaced a try/except/pass with contextlib.suppress in monitor/logger.py. Verified locally: ruff check/format clean, interrogate 91.3%, vulture clean, and tests/test_udp_bridge.py passes with cv2 absent (7 passed); 76 passed across pallas/logger/cl_sdk/feedback/doom suites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The last several
mainruns were red on all three jobs — none in the simulation core.What was failing
X | None,dictvsDict, unsorted/unused imports) inmonitor/andtraining/sharding.py.ModuleNotFoundError: No module named 'cv2'intests/test_udp_bridge.py::TestVirtualCL1::test_init. ConstructingVirtualCL1Server(with vis on by default) eagerly importedmonitor/mjpeg, whose top-levelimport cv2is only needed to JPEG-encode dashboard frames.vultureexited 3 on intentionally-unused params.Fixes
ruff check --fix+ruff format(bulk of the diff is formatting).import cv2lazy insideNeuralMJPEGServer.update_frame; declaredopencv-pythonin thevizdoomextra so the dashboard still resolves it.[tool.vulture] ignore_names = ["colorby", "exc", "format"]for the public plotting kwarg, context-manager*exc, and thelog_messageoverride.neuron_idsincore/pallas_ops.py; replaced atry/except/passwithcontextlib.suppressinmonitor/logger.py.Verification (local)
ruff check/ruff format --checkclean · interrogate 91.3% · vulture cleantests/test_udp_bridge.py→ 7 passed with cv2 absent🤖 Generated with Claude Code