Fix TypeError on missing fps metadata; run CI on pull requests - #63
Open
jankoslavic wants to merge 1 commit into
Open
Fix TypeError on missing fps metadata; run CI on pull requests#63jankoslavic wants to merge 1 commit into
jankoslavic wants to merge 1 commit into
Conversation
jankoslavic
force-pushed
the
fix/fps-metadata-and-pr-ci
branch
from
August 10, 2026 19:52
71109e2 to
7932f52
Compare
`_initalise_image_files` passed `image_meta.get("fps", None)` straight to
`configure`, which does `float(kwargs["fps"])` whenever the key is present.
For a multi-image file whose metadata carries no fps this raised
`TypeError: float() argument must be ...` during `VideoReader` construction.
Only call `configure` when an fps was actually reported.
The testing workflow triggered on `push` only, so pull requests from forks
never ran any checks (#62 was merged without CI). Trigger on `pull_request`
as well, and limit the push trigger to `master` so in-repo branches do not
run the matrix twice per push.
jankoslavic
force-pushed
the
fix/fps-metadata-and-pr-ci
branch
from
August 10, 2026 20:09
7932f52 to
c09a05a
Compare
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.
Two follow-ups to #62.
1.
TypeErrorwhen a multi-image file has no fps metadata_initalise_image_filespassed the result ofimage_meta.get("fps", None)straight intoconfigure:configuregates on"fps" in kwargsand then doesfloat(kwargs["fps"]), so a missing fps key becomesfloat(None)— aTypeErrorraised duringVideoReaderconstruction, for every multi-image file (e.g. a multi-page TIFF) whose metadata does not report a frame rate. The, None)default suggests the missing case was anticipated; it just was not guarded. Nowconfigureis only called when an fps was actually reported.Not covered by the current test data: the PNG sequence takes the
n_images is Nonebranch, and the gif does report fps. Adding a fixture without fps metadata would be worth doing separately.2. Pull requests never ran CI
python_package_testing.yamltriggered onpushonly, so a PR from a fork produced no checks at all — #62 was reviewed and merged with nothing green to look at. This adds thepull_requesttrigger and scopes the push trigger tomaster, so in-repo branches do not run the 3-version matrix twice on every push.Note that this PR is itself the first one that should show checks.
Still open
The root cause behind the #62 test bug —
VideoReader.configure(**kwargs)silently ignoring unknown keywords, which is howuse_channel=sat in the tests testing nothing — is deliberately left out of this PR. Per @itomac's comment, worth handling separately; an explicit keyword signature (as_dic.pyand the other methods already use) would raiseTypeErrorfor free, which catches more than a warning does.🤖 Generated with Claude Code