Skip to content

Stop storing a figure that was never built, and reach the floor #370 sets - #374

Merged
alexarje merged 1 commit into
masterfrom
mypy-tail-6
Aug 23, 2026
Merged

Stop storing a figure that was never built, and reach the floor #370 sets#374
alexarje merged 1 commit into
masterfrom
mypy-tail-6

Conversation

@alexarje

Copy link
Copy Markdown
Contributor

Continuing the tail of #350. mypy 34 → 26, 682 tests pass. This is where the remaining count stops being a matter of effort.

Four pose methods stored None as though it were a figure

Since the render helpers gained honest return types, self.pose_waterfall_figure = mgf could write None into an attribute declared to hold an MgFigure. The assignment is conditional now: a figure that could not be built leaves the attribute absent, which is what the declared-attribute model means and what keeps hasattr truthful. A stored None would have been found by show() and then failed on it.

Three lazily built things behind a flag mypy will not correlate

The GPU Farneback object is created under _use_gpu and used under _use_gpu; the two Eulerian lowpass pyramids are built together on the first frame and used together after. Asserted at use, annotated at declaration.

The floor

Nine of the twenty-six that remain are inside motion_mp(), which raises on its first call — #370. Typing code that cannot run would be work spent hiding a breakage, so those are untouched.

That leaves 17 addressable, and it means zero is not reachable while #370 stands. Whoever takes || true off the CI step is choosing between repairing that function, retiring it, and allowlisting the one file.

Checked by hand that both Eulerian modes still run, including the motion mode that uses those pyramids.

🤖 Generated with Claude Code

…sets

#350's tail: mypy 34 to 26. This is where the remaining count stops being a
matter of effort.

*Four pose methods stored None as though it were a figure.* Since the render
helpers gained honest return types, `self.pose_waterfall_figure = mgf` could
write None into an attribute declared to hold an MgFigure. The assignment is
now conditional: a figure that could not be built leaves the attribute absent,
which is what the whole declared-attribute model means and what keeps `hasattr`
truthful. Storing None would have been found by `show()` and then failed on it.

*Three lazily built things, guarded by a flag mypy will not correlate.* The GPU
Farneback object is created under `_use_gpu` and used under `_use_gpu`; the two
Eulerian lowpass pyramids are built together on the first frame and used
together afterwards. Asserted where they are used, and annotated where they are
declared.

THE FLOOR. Nine of the twenty-six that remain are inside `motion_mp()`, which
raises on its first call --- issue #370. Typing code that cannot run would be
work spent to hide a breakage, so those are left exactly as they are. Seventeen
are addressable without touching it, which means zero is not reachable while
#370 stands. Whoever takes the `|| true` off the CI step is choosing between
repairing that function, retiring it, and allowlisting the one file.

682 tests pass, 4 skipped. Checked by hand that both Eulerian modes still run,
including the motion mode that uses the pyramids above.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@alexarje
alexarje merged commit 6435303 into master Aug 23, 2026
12 checks passed
@alexarje
alexarje deleted the mypy-tail-6 branch August 23, 2026 16:46
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.

1 participant