Skip to content

Add passthrough mode to GaussianSmoothingFilterTransformer - #175

Merged
cboulay merged 1 commit into
devfrom
feat-gaussian-passthrough
Jul 13, 2026
Merged

Add passthrough mode to GaussianSmoothingFilterTransformer#175
cboulay merged 1 commit into
devfrom
feat-gaussian-passthrough

Conversation

@cboulay

@cboulay cboulay commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • GaussianSmoothingFilterTransformer now acts as a passthrough (no smoothing) when settings describe a degenerate kernel: sigma is None or <= 0, width is None or <= 0, or kernel_size is provided and <= 1.
  • The check lives in the design wrapper, which returns None coefficients — rather than returning None from get_design_function — so passthrough works on both the sync __call__ path and the async unit path (__acall___reset_state, which calls design_fun(fs) without a None check). Downstream, FilterTransformer with coefs=None already returns messages untouched, matching the established Butterworth order=0 pattern.
  • Smoothing can be disabled and re-enabled live via update_settings.

Behavior change

kernel_size=1 on the transformer previously designed a single-tap identity kernel with a UserWarning; it is now a silent passthrough. The standalone gaussian_smoothing_filter_design function is unchanged and still raises ValueError on 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 and coefs is None on 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 via update_settings.
  • Replaced the old kernel_size=1 warning test with test_gaussian_identity_kernel_design_warns for the standalone design function.

Full unit suite passes: 3593 passed, 5 skipped.

🤖 Generated with Claude Code

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.
@cboulay
cboulay merged commit f66a08f into dev Jul 13, 2026
14 checks passed
@cboulay
cboulay deleted the feat-gaussian-passthrough branch July 13, 2026 01:10
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