Repository navigation
Conversation
… traceback (Breakthrough#604) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Breakthrough
left a comment
There was a problem hiding this comment.
Thanks for the PR, have a few small changes to ask, but other than these LGTM.
| return parsed.frame_num | ||
|
|
||
| @staticmethod | ||
| def _validate_kernel_size(kernel_size: int | None) -> int | None: |
There was a problem hiding this comment.
Can we re-use KernelSizeValue here the same way --crop uses CropValue? That would also let -k -1 mean auto, like the config file.
There was a problem hiding this comment.
Done in 4a4b66e. -k now goes through KernelSizeValue, like --crop uses CropValue, so -k -1 means auto and a bad value gives a usage error.
| [ | ||
| ["detect-content", "-k", "1"], | ||
| ["detect-content", "-k", "4"], | ||
| ["detect-adaptive", "-k", "1"], |
There was a problem hiding this comment.
Can you add cases for -k -1 and a negative value, plus a valid size (e.g. -k 3) that should succeeds?
There was a problem hiding this comment.
Added in 4a4b66e: -k -3 and -k -2 are rejected, and -k 3 and -k -1 succeed, for both detect-content and detect-adaptive.
| self._value = None | ||
| elif value < 0: | ||
| # Disallow other negative values. | ||
| elif value < 3: |
There was a problem hiding this comment.
Please add a changelog entry (at the very bottom under 0.8, website/pages/changelog.md), noting that kernel-size = 1 in a config file is now going to be an error.
There was a problem hiding this comment.
Added the changelog entry under 0.8 in 4a4b66e, noting that kernel-size = 1 in a config file is now an error.
|
All three points are done in 4a4b66e: |
Closes #604
-k/--kernel-sizeofdetect-contentanddetect-adaptivewas passed toContentDetectorunchecked, so 1, even or negative values ended in aValueErrortraceback. It is now validated inCliContextand reported asclick.BadParameter, as--weightsand--downscalealready are:KernelSizeValuealso acceptedkernel-size = 1from a config file, contrary to its docstring, and the detector then raised. It now rejects values below 3 (except -1 = auto), and its message says ">= 3", matching the CLI help, scenedetect.cfg and the docs.Note: on the command line
-k -1is now also rejected with a usage error. The CLI help never documented -1 for-k(only the config file does), and today-k -1crashes with the same traceback.Tests:
test_cli_kernel_size_rejects_invalid(3 CLI cases) andtest_cli_kernel_size_config_file_rejects_one(2 config cases) fail on main (5 failed) and pass with this change (5 passed). In the full suite the only failures are 2 moviepy tests that fail the same way on main because moviepy is not installed locally.AI disclosure: prepared with Claude Code (Claude Opus 5.5) and reviewed by me.
🤖 Generated with Claude Code