fix(decode): a Blastware event's record type comes from its bytes, not its filename (#41)

STRT[18] is the record-type byte: 0x46 on every one of DL2's 6,577
waveform files, 0x0A on every one of its 63,535 histograms.  The decoder
read the type from the filename's last letter, so an event with no
Blastware name -- SFM's own downloads, the call-in path -- or a manual
download ('.QZ0') came out 'Waveform' whatever it was.

The filename is now a cross-check that logs a disagreement; the bytes
win.  An unknown byte (Manual / Event / Combo never occur in DL2) is
record_type None with a decode_problems entry, not a guess.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-29 23:06:25 -04:00
1 parent b92c8e489e
commit 46daea17b2
3 files changed
+55 -10

No files matched your search

+3 -4
View File
@@ -31,11 +31,10 @@ def test_histogram_interval_peak_in_counts():
assert s.counts["Tran"] == [7776] and s.values["NumberofIntervals"] == 1
def test_no_filename_reaches_the_decoder():
# The type must come from the bytes; today they can't tell it (#41), so this
# histogram reads as a waveform. Update to "Full Histogram" when #41 lands.
def test_event_type_comes_from_the_bytes():
# No filename reaches the decoder; the type is the STRT record-type byte (#41).
s = sfm_side((FIX / "M529L4XQ.R30H").read_bytes())
assert s.values["EventType"] == "Full Waveform"
assert s.values["EventType"] == "Full Histogram"
def test_report_fields_stay_blank():