Add passthrough setting to EWMASettings for identity bypass#155
Merged
Conversation
EWMASettings gains a `passthrough` flag that returns the input unchanged, skipping the EWMA entirely. Unlike a very large time_constant -- which still applies a stale, locked baseline -- passthrough is true identity. It applies to EWMAUnit, DetrendUnit, and AdaptiveStandardScaler, and is in NONRESET_SETTINGS_FIELDS so it can be toggled at runtime without resetting filter state.
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
Adds a
passthrough: bool = Falsefield toEWMASettingsthat, when set, returns the input message unchanged (identity), skipping the EWMA entirely.Previously the only way to approximate "off" was a very large
time_constant, but that still subtracts/applies a stale, locked baseline rather than passing data through untouched.EWMATransformer.__call__/__acall__short-circuit whenpassthroughis set;DetrendTransformerinherits this, soEWMAUnitandDetrendUnitboth support it.AdaptiveStandardScalerTransformergets the same short-circuit (its settings class already inherited the field; it is now honored). Child EWMAs are unaffected, so there is no double-gating.passthroughis inNONRESET_SETTINGS_FIELDSfor both transformers, so it can be toggled at runtime (e.g. viaINPUT_SETTINGS) without resetting filter state — when processing resumes, the baseline/statistics pick up where they left off.The legacy
RiverAdaptiveStandardScalerTransformeris untouched (its settings don't derive fromEWMASettings).Test plan
test_ewma.py,test_detrend.py,test_scaler.pycovering identity output, state preservation across a passthrough toggle, andupdate_settingsnot queueing a reset.