Stop storing a figure that was never built, and reach the floor #370 sets - #374
Merged
Conversation
…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>
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.
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
Noneas though it were a figureSince the render helpers gained honest return types,
self.pose_waterfall_figure = mgfcould writeNoneinto an attribute declared to hold anMgFigure. 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 keepshasattrtruthful. A storedNonewould have been found byshow()and then failed on it.Three lazily built things behind a flag mypy will not correlate
The GPU Farneback object is created under
_use_gpuand 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
|| trueoff 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
motionmode that uses those pyramids.🤖 Generated with Claude Code