annotationsfix #19

Merged
madrigal merged 23 commits from annotationsfix into main 2026-04-20 15:57:23 -04:00
G
Owner
No description provided.
gillian added 2 commits 2026-03-31 14:50:43 -04:00
F Port annotation system from utils and fix ria package imports
Annotations package (new):
- Add threshold_qualifier with 3-pass hysteresis detector (Pass 1: strong
  bursts, Pass 2: weak residual bursts, Pass 3: macro-window faint burst
  detection), auto window_size scaled to 1ms, channel selection, and
  stable noise_floor baseline throughout
- Add energy_detector, cusum_annotator, parallel_signal_separator,
  qualify_slice, signal_isolation, annotation_transforms
- Add __init__.py exporting the four functions used by the CLI
- Fix all imports from utils.data → ria_toolkit_oss.datatypes

CLI annotate command (new):
- Port full annotate CLI from utils including list, add, remove, clear,
  energy, cusum, threshold, and separate subcommands
- Fix imports from utils.* → ria_toolkit_oss.* and utils_cli.* →
  ria_toolkit_oss_cli.*
- Safe overwrite logic: _annotated files always writable, originals
  protected; --overwrite writes in-place only on _annotated inputs

CLI view command:
- Add 'annotations' as a valid --type, wiring view_annotations from
  view_signal

view_signal.py:
- Add view_annotations function with blue/purple alternating palette and
  threshold %-sorted drawing order (lower % renders on top)

recording.py (datatypes):
- Fix lazy imports in to_wav() and to_blue() from utils.io → ria_toolkit_oss.io

io/recording.py:
- Add compatibility shim in from_npy to remap utils.data.annotation.Annotation
  to ria_toolkit_oss.datatypes.annotation.Annotation when loading .npy files
  pickled by the utils package
11d9532b5c
F Removing logos
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Failing after 1s
Build Project / Build Project (3.10) (pull_request) Failing after 1s
Build Project / Build Project (3.11) (pull_request) Failing after 1s
Build Project / Build Project (3.12) (pull_request) Failing after 1s
Test with tox / Test with tox (3.10) (pull_request) Failing after 1s
Test with tox / Test with tox (3.11) (pull_request) Failing after 1s
Test with tox / Test with tox (3.12) (pull_request) Failing after 1s
2bb2d9d5a7
G gillian requested review from madrigal 2026-03-31 14:50:48 -04:00
gillian added 9 commits 2026-03-31 14:57:07 -04:00
F Merge branch 'annotationsfix' of https://riahub.ai/qoherent/ria-toolkit-oss into annotationsfix
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Failing after 1s
Build Project / Build Project (3.10) (pull_request) Failing after 1s
Build Project / Build Project (3.11) (pull_request) Failing after 1s
Build Project / Build Project (3.12) (pull_request) Failing after 1s
Test with tox / Test with tox (3.10) (pull_request) Failing after 1s
Test with tox / Test with tox (3.11) (pull_request) Failing after 1s
Test with tox / Test with tox (3.12) (pull_request) Failing after 1s
ee2ce3b1f4
gillian added 1 commit 2026-03-31 15:16:59 -04:00
F Fix merge conflicts and port all imports from utils to ria_toolkit_oss
Resolves unresolved merge conflict markers left in committed files across
the annotations, view, data, and CLI packages. Updates all remaining
imports from the old utils.* namespace to ria_toolkit_oss.datatypes,
ria_toolkit_oss.io, and ria_toolkit_oss.view equivalents.
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Failing after 1s
Build Project / Build Project (3.10) (pull_request) Failing after 1s
Build Project / Build Project (3.11) (pull_request) Failing after 1s
Build Project / Build Project (3.12) (pull_request) Failing after 1s
Test with tox / Test with tox (3.10) (pull_request) Failing after 1s
Test with tox / Test with tox (3.11) (pull_request) Failing after 1s
Test with tox / Test with tox (3.12) (pull_request) Failing after 1s
5cfced8855
gillian added 1 commit 2026-03-31 15:28:20 -04:00
F Update to be accurate to ria toolkit
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 14m18s
Build Project / Build Project (3.10) (pull_request) Successful in 5m4s
Test with tox / Test with tox (3.10) (pull_request) Failing after 47s
Build Project / Build Project (3.11) (pull_request) Successful in 1m16s
Build Project / Build Project (3.12) (pull_request) Successful in 1m16s
Test with tox / Test with tox (3.11) (pull_request) Failing after 34s
Test with tox / Test with tox (3.12) (pull_request) Failing after 34s
5d909c4a22
madrigal added 2 commits 2026-04-02 10:37:52 -04:00
M Linting
Some checks failed
Build Project / Build Project (3.12) (pull_request) Failing after 1s
Test with tox / Test with tox (3.11) (pull_request) Failing after 1s
Test with tox / Test with tox (3.12) (pull_request) Failing after 1s
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 46s
Build Project / Build Project (3.10) (pull_request) Successful in 7m7s
Test with tox / Test with tox (3.10) (pull_request) Failing after 13m42s
Build Project / Build Project (3.11) (pull_request) Successful in 4m31s
cfa1da9f4d
madrigal added 2 commits 2026-04-02 10:52:41 -04:00
M Fixed import typo
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Failing after 1m56s
Build Project / Build Project (3.11) (pull_request) Failing after 1m54s
Build Project / Build Project (3.12) (pull_request) Failing after 5s
Test with tox / Test with tox (3.10) (pull_request) Failing after 3s
Test with tox / Test with tox (3.11) (pull_request) Failing after 0s
Test with tox / Test with tox (3.12) (pull_request) Failing after 0s
Build Project / Build Project (3.10) (pull_request) Successful in 3m3s
c7b88f1f14
madrigal added 1 commit 2026-04-02 11:01:02 -04:00
M Merge branch 'main' of https://riahub.ai/qoherent/ria-toolkit-oss into annotationsfix
Some checks failed
Test with tox / Test with tox (3.12) (pull_request) Failing after 0s
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 15s
Build Project / Build Project (3.10) (pull_request) Successful in 57s
Build Project / Build Project (3.11) (pull_request) Successful in 56s
Build Project / Build Project (3.12) (pull_request) Successful in 55s
Test with tox / Test with tox (3.11) (pull_request) Failing after 12s
Test with tox / Test with tox (3.10) (pull_request) Failing after 23s
3eb084bc08
madrigal added 1 commit 2026-04-02 11:07:23 -04:00
M Linting and updated poetry.lock
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 15m55s
Build Project / Build Project (3.10) (pull_request) Successful in 59s
Build Project / Build Project (3.11) (pull_request) Successful in 58s
Build Project / Build Project (3.12) (pull_request) Successful in 56s
Test with tox / Test with tox (3.12) (pull_request) Successful in 1m4s
Test with tox / Test with tox (3.11) (pull_request) Successful in 3m8s
Test with tox / Test with tox (3.10) (pull_request) Failing after 46s
1005228d69
M madrigal requested changes 2026-04-02 11:59:09 -04:00
Dismissed
@ -0,0 +49,4 @@
from ria_toolkit_oss.datatypes import Annotation, Recording
def _find_ranges(indices, max_gap):
Member

One of the pytests failed because the starting point for an annotation wasn't within the expected range. I checked what the annotation looked like (image attached), and the range does look to be too wide. I think we need to take another look at the threshold qualifier and how it determines the range

One of the pytests failed because the starting point for an annotation wasn't within the expected range. I checked what the annotation looked like (image attached), and the range does look to be too wide. I think we need to take another look at the threshold qualifier and how it determines the range
muq added 2 commits 2026-04-20 12:23:52 -04:00
M Port threshold_qualifier improvements and Pass 2 spillover fix from utils
The OSS threshold_qualifier was last synced from utils on Feb 23 2026,
before the major robustness improvements landed in utils on Mar 19 2026.
This commit brings it fully up to date.

Changes ported from utils:
- Multi-pass detection (Pass 1 strong burst, Pass 2 weak residual,
  Pass 3 sustained faint burst via macro-window averaging)
- Noise floor estimation via percentile instead of simple max*threshold
- Dynamic range ratio guard (early exit on low-contrast captures)
- Improved _find_ranges, _expand_and_filter_ranges, _merge_ranges helpers
- Spectral smoothing in _estimate_spectral_bounds for wideband bursts
- Minimum duration filter expressed in absolute time (5ms) not sample count

Also includes the Pass 2 hysteresis spillover fix:
- Pass 2 expansion now runs against residual_power (masked) instead of
  smoothed_power, preventing it from walking into Pass 1 territory
- Pass 2 mask now has a window_size guard band around Pass 1 ranges,
  matching the guard already used in Pass 3

Only change from utils: import swapped to ria_toolkit_oss.datatypes.
93ae08bc91
M Resolve merge conflict: keep Pass 2 spillover fix over remote's buggy version
Remote annotationsfix had a partial port of threshold_qualifier without
the Pass 2 hysteresis spillover fix. Kept our corrected version in both
conflicting sections:
- Pass 2 mask expanded by window_size guard band around Pass 1 ranges
- Pass 2 expansion runs against residual_power instead of smoothed_power
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 18s
Build Project / Build Project (3.12) (pull_request) Successful in 3m21s
Test with tox / Test with tox (3.11) (pull_request) Successful in 3m24s
Build Project / Build Project (3.11) (pull_request) Successful in 3m35s
Build Project / Build Project (3.10) (pull_request) Successful in 3m37s
Test with tox / Test with tox (3.10) (pull_request) Failing after 4m6s
Test with tox / Test with tox (3.12) (pull_request) Successful in 4m25s
d3a7e9ef0f
M
Member

Summary

  • Ports the full threshold_qualifier robustness improvements from utils (landed Mar 19 2026, not previously synced to OSS) — multi-pass detection (Pass 1/2/3), noise floor estimation, spectral smoothing, improved range helpers, and absolute-time minimum duration filter
  • Includes the Pass 2 hysteresis spillover fix: expansion now runs against residual_power instead of smoothed_power, and the Pass 2 mask now has a window_size guard band around Pass 1 ranges (mirrors existing Pass 3 behavior)
  • Fixes broken imports across all ported annotation files (utils.dataria_toolkit_oss.datatypes)
  • Minor view.py fixes: indentation correction in VISUALIZATION_TYPES and --type annotate/--type annotation CLI aliases added

Context

OSS was last synced from utils on Feb 23 2026, before the major improvements. The spillover bug was independently reproduced on the utils side after merge and fixed there first — this PR brings OSS fully in line with that fixed state. Note: a remote version of threshold_qualifier.py without the spillover fix was present on this branch and was overridden during merge resolution.

Files changed

  • annotations/threshold_qualifier.py — full port + spillover fix
  • annotations/annotation_transforms.py — import fix
  • annotations/cusum_annotator.py — import fix
  • annotations/energy_detector.py — import fix
  • annotations/parallel_signal_separator.py — import fix
  • annotations/qualify_slice.py — import fix
  • annotations/signal_isolation.py — import fix
  • ria_toolkit_oss_cli/ria_toolkit_oss/view.py — indentation + CLI aliases
## Summary - Ports the full threshold_qualifier robustness improvements from utils (landed Mar 19 2026, not previously synced to OSS) — multi-pass detection (Pass 1/2/3), noise floor estimation, spectral smoothing, improved range helpers, and absolute-time minimum duration filter - Includes the Pass 2 hysteresis spillover fix: expansion now runs against `residual_power` instead of `smoothed_power`, and the Pass 2 mask now has a `window_size` guard band around Pass 1 ranges (mirrors existing Pass 3 behavior) - Fixes broken imports across all ported annotation files (`utils.data` → `ria_toolkit_oss.datatypes`) - Minor `view.py` fixes: indentation correction in `VISUALIZATION_TYPES` and `--type annotate`/`--type annotation` CLI aliases added ## Context OSS was last synced from utils on Feb 23 2026, before the major improvements. The spillover bug was independently reproduced on the utils side after merge and fixed there first — this PR brings OSS fully in line with that fixed state. Note: a remote version of `threshold_qualifier.py` without the spillover fix was present on this branch and was overridden during merge resolution. ## Files changed - `annotations/threshold_qualifier.py` — full port + spillover fix - `annotations/annotation_transforms.py` — import fix - `annotations/cusum_annotator.py` — import fix - `annotations/energy_detector.py` — import fix - `annotations/parallel_signal_separator.py` — import fix - `annotations/qualify_slice.py` — import fix - `annotations/signal_isolation.py` — import fix - `ria_toolkit_oss_cli/ria_toolkit_oss/view.py` — indentation + CLI aliases
madrigal added 1 commit 2026-04-20 14:39:03 -04:00
M Merge branch 'main' of https://riahub.ai/qoherent/ria-toolkit-oss into annotationsfix
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 3m24s
Test with tox / Test with tox (3.11) (pull_request) Successful in 4m22s
Test with tox / Test with tox (3.10) (pull_request) Failing after 5m51s
Test with tox / Test with tox (3.12) (pull_request) Successful in 6m37s
Build Project / Build Project (3.10) (pull_request) Successful in 15m30s
Build Project / Build Project (3.12) (pull_request) Successful in 18m52s
Build Project / Build Project (3.11) (pull_request) Successful in 19m20s
d6c66d2a07
benchinnery added 1 commit 2026-04-20 15:08:32 -04:00
Add noqa C901 to view() to pass flake8 complexity check
All checks were successful
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 17m39s
Build Project / Build Project (3.10) (pull_request) Successful in 18m13s
Build Project / Build Project (3.12) (pull_request) Successful in 8m42s
Build Project / Build Project (3.11) (pull_request) Successful in 9m2s
Test with tox / Test with tox (3.10) (pull_request) Successful in 4m34s
Test with tox / Test with tox (3.12) (pull_request) Successful in 5m27s
Test with tox / Test with tox (3.11) (pull_request) Successful in 17m4s
db000da517
M madrigal approved these changes 2026-04-20 15:54:41 -04:00
M madrigal left a comment
Member

The updates to annotations all look good

The updates to annotations all look good
M madrigal merged commit ef772a3755 into main 2026-04-20 15:57:23 -04:00
M madrigal deleted branch annotationsfix 2026-04-20 15:57:30 -04:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: qoherent/ria-toolkit-oss#19
No description provided.