Feat/time dependent config engine#225
Open
viktorbeck98 wants to merge 3 commits into
Open
Conversation
Add a time_dependent config that cuts StabilityClassifier segments at equal-duration boundaries of the observed time span instead of equal-count boundaries of the change series. - StabilityClassifier.is_stable gains optional timestamps; boundaries via np.searchsorted on equal-duration cuts, count-mode fallback on missing/mismatched/non-finite timestamps or zero span (never raises) - SingleStabilityTracker(time_dependent=...) stores exact per-occurrence timestamps; state round-trips via msgpack, legacy snapshots load - timestamp threaded EventPersistency.ingest_event -> add_data -> add_value as optional trailing param; dataframe backends accept+ignore - EventStabilityTracker(time_dependent=...) forwards via closure factory (survives load(), mirroring expand_value) Default off is bit-for-bit unchanged. 17 new tests; full suite 550 pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
viktorbeck98
marked this pull request as ready for review
July 21, 2026 13:30
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.
Task
Description
Adds an opt-in
time_dependentmode to the stability classification, making the auto-configuration time-based instead of event-count-based.StabilityClassifier.is_stable()accepts an optionaltimestampslist and cuts its 4 threshold segments at equal-duration boundaries over the observed time span (vianp.searchsorted). Falls back silently to the existing equal-count segmentation on any missing/invalid timestamps — it never raises.SingleStabilityTracker(time_dependent=True)stores per-occurrence timestamps and passes them to classification; flag and timestamps survive msgpack persistence round-trips, legacy snapshots still load.timestamp: float | None = Noneis threaded throughEventPersistency.ingest_event→EventDataStructure.add_data→ trackeradd_value; dataframe backends accept and ignore it.EventStabilityTracker(time_dependent=...)forwards the flag likeexpand_value.time_dependent=False, no timestamps) is bit-for-bit identical to current behavior.SingleTracker.add_value/EventDataStructure.add_datasignatures gained an optional trailingtimestampparameter — out-of-tree subclasses must accept it.Design/formulation background lives in the
configuration_engine2.0research repo.How Has This Been Tested?
tests/test_persistency/test_time_dependent_stability.py: boundary computation (incl.None/NaN/zero-span/mismatch fallbacks), count-vs-time divergence on a burst-then-drip series, persistence round-trip, and end-to-end plumbing throughEventPersistency.Checklist