CI runs `pre-commit run --all-files` which surfaces every latent issue
across the eval suite, not just the ones in changed files. Before this
commit, that surfaced 9 ruff errors and 47 mypy errors that had built
up over earlier PRs (last touched in `[style] eval: ruff/yapf pass` and
related). Cleaning them in one sweep so subsequent eval PRs land green.
Ruff
- yapf reformat: 3 files (entrypoints/cli/eval.py, optical_flow/_shared.py,
physics_iq/utils.py).
- B024: drop ABC inheritance from PromptDataset (it has no abstract
methods; subclasses just populate self._rows).
- B027: BaseMetric.setup is intentionally an optional no-op override
(metrics with no eager state inherit it). Document and noqa instead
of forcing every native metric to declare an empty override.
- SIM105 / SIM115: contextlib.suppress for ipc_collect, mkstemp for
the temp video file in vbench.scene.
- UP038: isinstance(x, (A, B)) -> isinstance(x, A | B).
Mypy
- Optional-narrowing pattern across 12 metric files: each metric class
initialised self._model (and sometimes _processor / _tokenizer /
_head) to None and reassigned in setup(), but mypy narrows the type
to None and flags every later attribute access. Annotate the slots
as Any. Same fix already applied to physics_iq + human_action +
videoscore2 in earlier commits; this extends it to the rest of the
suite.
- Untyped helpers: annotate _safe_amt_forward (motion_smoothness),
_patch_detectron2_registries (_grit_helper), _Loader (vbench/__init__).
- _grit_helper: function-attribute writes (`func._patched_idempotent`)
type: ignore'd at the assignment site.
- imaging_quality: rename `all_scores` rebinding to `chunks` / `per_frame`
so mypy doesn't carry the list[Any] type into the cat'd tensor.
- worker._resolve_video_input: add Any -> Any annotation.
No runtime behaviour changes. 33/33 eval pytest still pass.