Skip to content

feat(counter): distinguish transient vs impulsive anomalies#18

Merged
ahmadtourei merged 5 commits intomainfrom
classifier_count
Dec 3, 2025
Merged

feat(counter): distinguish transient vs impulsive anomalies#18
ahmadtourei merged 5 commits intomainfrom
classifier_count

Conversation

@ahmadtourei
Copy link
Collaborator

This PR extends the counter module to report:

  • Impulsive events: isolated single detections.
  • Transient events: consecutive/overlapping detections grouped into one event (configurable via max_gap_seconds).
  • Raw hits: total matching lines (unchanged from before).

Details

  • Adds classify_types=True to output counts and representative lines for impulsive and transient groups.
  • Preserves existing behavior; set collapse_transients=True to get a single collapsed count if classification isn’t needed.
  • Sorting is based on timestamps parsed from filenames (fallback to basename order when parsing fails).

Example

from das_anomaly.count.counter import CounterConfig, AnomalyCounter

cfg = CounterConfig(keyword="anomaly", classify_types=True, max_gap_seconds=0)
print(AnomalyCounter(cfg).run())

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.18%. Comparing base (913e3d3) to head (0f77c7d).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
das_anomaly/count/counter.py 31.37% 70 Missing ⚠️
das_anomaly/detect/detector.py 36.84% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
- Coverage   92.40%   83.18%   -9.23%     
==========================================
  Files          13       13              
  Lines         685      791     +106     
==========================================
+ Hits          633      658      +25     
- Misses         52      133      +81     
Flag Coverage Δ
python-3.10 83.18% <33.33%> (-9.23%) ⬇️
python-3.11 83.18% <33.33%> (-9.23%) ⬇️
python-3.12 83.18% <33.33%> (-9.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ahmadtourei ahmadtourei merged commit 9730bd8 into main Dec 3, 2025
18 of 20 checks passed
@ahmadtourei ahmadtourei deleted the classifier_count branch December 3, 2025 20:54
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