Spaces:
Sleeping
Sleeping
Download scripts/test_note_alignment_report.py from jasonmdong/notepilot: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/spaces/jasonmdong/notepilot/resolve/main/scripts/test_note_alignment_report.py
- Command line
-
hf download hf://spaces/jasonmdong/notepilot/scripts/test_note_alignment_report.py
-
curl -L -o test_note_alignment_report.py https://huggingface.co/spaces/jasonmdong/notepilot/resolve/main/scripts/test_note_alignment_report.py
1.55 kB
| #!/usr/bin/env python3 | |
| import json | |
| from note_alignment_report import build_alignment | |
| def load(path): | |
| with open(path) as f: return build_alignment(json.load(f)) | |
| def main(): | |
| c5 = load('/tmp/notepilot-left-loop/mic-shadow-single-worklet-20260918.json') | |
| retry = load('/tmp/notepilot-left-loop/mic-self-onset-fix-live-20260918.json') | |
| final = load('/tmp/notepilot-left-loop/mic-previous-guard-live-final-20260918.json') | |
| assert c5['orphanAdvances'], 'C5 false advance was not exposed' | |
| assert retry['orphanAdvances'], 'previous-retry false advance was not exposed' | |
| assert not final['orphanAdvances'], 'post-guard trace gained an orphan advance' | |
| for out in (c5, retry, final): | |
| assert all(a.get('status') for a in out['attempts']) | |
| assert all(a.get('physicalMicArrivalKnown') is False for a in out['attempts']) | |
| assert not any(c.get('code') == 'SCORE_BIASED_PITCH_AS_ACOUSTIC' for c in out['sanityChecks']) | |
| assert 'runQuality' in out and 'suitableForTuning' in out['runQuality'] | |
| diag = load('/tmp/notepilot-left-loop/mic-follower-hold-diagnostics-20260918-v2.json') | |
| gsharp = [a for a in diag['attempts'] if a['scoreEventId'] == 1] | |
| assert len(gsharp) == 4 and all(a['holdTimeline'] for a in gsharp) | |
| assert all(a['peakPosteriorHold'] and a['peakEvidenceHold'] for a in gsharp) | |
| assert all('candidate' in h and 'runner' in h and 'onsetTiming' in h for a in gsharp for h in a['holdTimeline']) | |
| print('note alignment regression fixtures: PASS') | |
| if __name__ == '__main__': main() | |