Skip to content

feat(999.2): Tag Analysis Toolkit — 6 kind-aware analysis methods (getStats/resample/derivative/movingStat/exceedance/crossings)#376

Merged
HanSur94 merged 10 commits into
mainfrom
claude/github-issues-triage-df4390
Jul 9, 2026
Merged

feat(999.2): Tag Analysis Toolkit — 6 kind-aware analysis methods (getStats/resample/derivative/movingStat/exceedance/crossings)#376
HanSur94 merged 10 commits into
mainfrom
claude/github-issues-triage-df4390

Conversation

@HanSur94

@HanSur94 HanSur94 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the Tag Analysis Toolkit (Phase 999.2) — 6 new toolbox-free, Octave-safe, additive methods on the Tag base class (libs/SensorThreshold/Tag.m), inherited by every subclass via the getXY/getXYRange seam. All additive: no property, serialization, or interface changes.

Note on scope: this branch was opened to implement 8 approved triage features. While it was in flight, main independently shipped two of them — Tag.cumulativeIntegral() (#327, PR #331) and EventViewer.exportImage() (#321, PR #333). On merging main, this branch keeps main's canonical versions of both and drops its own duplicates. The net-new contribution here is the 6 remaining Tag methods below.

Features (net-new)

Method Issue
Tag.getStats(tStart,tEnd) — N/Min/Max/Mean/Rms/Std/First/Last/TimeStart/TimeEnd (keystone) Closes #223
Tag.resampleUniform(dt, ...) — kind-aware uniform-grid resample Closes #308
Tag.derivative(...) — central/forward/backward rate of change Closes #326
Tag.movingStat(window, type) — rolling mean/std/max/min/rms/median Closes #312
Tag.exceedance(level, ...) — time-above/below-threshold analysis Closes #316
Tag.crossings(level, ...) — level-crossing times + direction Closes #328

Already shipped on main (no longer part of this diff): #327 cumulativeIntegral, #321 EventViewer.exportImage.

Design notes

  • Octave-safe: NaN masking (no 'omitnan'), a hand-rolled centered-window loop (no movmean/movstd), interp1 linear/previous only.
  • Kind-aware: discrete (state/monitor) tags use zero-order-hold and raise Tag:*OnDiscrete warnings/guards instead of fabricating interpolated values, honouring the existing ZOH-only invariant.

Verification (MATLAB MCP, on the merged tree)

🤖 Generated with Claude Code

HanSur94 and others added 9 commits July 8, 2026 22:20
…Tag Analysis Toolkit, 999.3 EventViewer export)

Captures the 8 GitHub issues approved during the 2026-07-08 inbox triage:
- 999.2 Tag Analysis Toolkit: #223 getStats (keystone), #308 resampleUniform,
  #326 derivative, #312 movingStat, #316 exceedance, #328 crossings, #327 cumulativeIntegral
- 999.3 EventViewer image export parity: #321 exportImage

Also records the triage report at .planning/INBOX-TRIAGE.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keystone-first: 999.2-01 getStats (Wave 1); the six analysis methods
(resampleUniform, derivative, movingStat, exceedance, crossings,
cumulativeIntegral) as Wave 2 depending on 01. All additive, toolbox-free,
Octave-safe methods on libs/SensorThreshold/Tag.m + per-method headless tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Public getStats(tStart,tEnd) on the Tag base class returning
N/Min/Max/Mean/Rms/Std/First/Last/TimeStart/TimeEnd. Toolbox-free,
Octave-safe (NaN masking, not 'omitnan'), numeric-only reductions with
cellstr-StateTag + empty-window guards. Delegates to getXYRange so all
subclasses inherit it. Verified: 23/23 headless assertions, lint clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…328 #327)

All six append to the shared libs/SensorThreshold/Tag.m base class, so
they ship as one atomic wave (each depends only on the getXY/getXYRange
seam, none on each other):

- resampleUniform(dt,...) #308 — kind-aware uniform-grid resample
- derivative(...)        #326 — central/forward/backward rate of change
- movingStat(window,type)#312 — rolling mean/std/max/min/rms/median
- exceedance(level,...)  #316 — time-above/below-threshold analysis
- crossings(level,...)   #328 — level-crossing times + direction
- cumulativeIntegral(...)#327 — running trapezoidal totalizer

Plus private option-parse/series/peak helpers. Toolbox-free and
Octave-safe (hand-rolled movers + trapezoid, no 'omitnan'/movmean/cumtrapz;
interp1 linear/previous only). Additive only — no property/serialization
change. Verified via matlab MCP: 69 headless assertions across 6 test
files pass, static analysis clean, TestDerivedTag 35/35 (no regression).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ports DashboardEngine.exportImage's cross-platform backend (exportapp /
exportgraphics->print->getframe / Octave print+stub-axes) to the
EventViewer timeline figure. Format inferred from extension; notRendered
+ unknownImageFormat guards. Additive only. Verified via matlab MCP:
6/6 headless assertions, lint clean, TestEventViewer 7/7 (no regression).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lemented)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…triage-df4390

# Conflicts:
#	.planning/STATE.md
#	libs/SensorThreshold/Tag.m
@HanSur94 HanSur94 changed the title feat: Tag Analysis Toolkit (999.2) + EventViewer image export (999.3) — 8 approved features feat(999.2): Tag Analysis Toolkit — 6 kind-aware analysis methods (getStats/resample/derivative/movingStat/exceedance/crossings) Jul 8, 2026
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 304 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
libs/SensorThreshold/Tag.m 0.00% 304 Missing ⚠️

📢 Thoughts on this report? Let us know!

…er test

MISS_HIT requires a space after each ';' in the cell literal
{'N'; 'Min'; ...}. No behavior change; test still 23/23.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HanSur94
HanSur94 merged commit d38069e into main Jul 9, 2026
19 of 20 checks passed

HanSur94 commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

Wiki docs check for this merge:

The 6 new Tag analysis methods (getStats, resampleUniform, derivative, movingStat, exceedance, crossings) are auto-documented — the Generate API Docs workflow ran on the merge commit and updated API Reference: Sensors with signatures + descriptions for all six (repo commit 1ed09c1, synced to the wiki repo).

The rest of the diff (.planning/**, new test files) is internal/process content with no additional user-facing surface, so no further wiki changes are needed. No narrative guide page covers base Tag methods today (consistent with cumulativeIntegral in #331 getting the same auto-ref-only treatment), so I left that as-is rather than inventing a new page.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment