Add passthrough mode to GaussianSmoothingFilterTransformer - #175
Merged
Conversation
Degenerate smoothing settings (sigma None or <= 0, width None or <= 0, kernel_size <= 1) now disable smoothing: the transformer passes messages through unchanged instead of raising. The design wrapper returns None coefficients (rather than None from get_design_function) so passthrough works on both the sync __call__ path and the async unit path, and can be toggled live via update_settings. kernel_size=1 previously designed a warning single-tap identity kernel; it is now a silent passthrough. The standalone design function still raises/warns as before.
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.
Summary
GaussianSmoothingFilterTransformernow acts as a passthrough (no smoothing) when settings describe a degenerate kernel:sigmaisNoneor<= 0,widthisNoneor<= 0, orkernel_sizeis provided and<= 1.Nonecoefficients — rather than returningNonefromget_design_function— so passthrough works on both the sync__call__path and the async unit path (__acall__→_reset_state, which callsdesign_fun(fs)without aNonecheck). Downstream,FilterTransformerwithcoefs=Nonealready returns messages untouched, matching the established Butterworthorder=0pattern.update_settings.Behavior change
kernel_size=1on the transformer previously designed a single-tap identity kernel with aUserWarning; it is now a silent passthrough. The standalonegaussian_smoothing_filter_designfunction is unchanged and still raisesValueErroron invalid inputs (and warns on an identity kernel).Tests
test_gaussian_passthrough_settings: parametrized over all nine degenerate settings; asserts identity passthrough with no warnings andcoefs is Noneon the inner filter.test_gaussian_passthrough_async_path: drives__acall__directly to guard the pipeline path that bypasses the sync shortcut.test_gaussian_passthrough_toggle: disable → enable → disable viaupdate_settings.kernel_size=1warning test withtest_gaussian_identity_kernel_design_warnsfor the standalone design function.Full unit suite passes: 3593 passed, 5 skipped.
🤖 Generated with Claude Code