feat(checker): read each mic value in the unit Blastware printed; carve out mixed columns
Blastware's dB(L) / psi(L) labels do not hold for the mic on every report (DL2, 2026-11-09): - the mic peak carries its own <Units>, which 7 reports set to dB under a psi Units line and 3 the reverse: the checker now reads the peak in its own unit; - a mic sample table has no unit of its own and need not follow the line (S353JTHU.DT0W prints dB under psi): the checker reads it from its cells -- a mic dB value is never under 60, psi never over 1; - some reports mix the two inside one column: K441L9IN.OT0W prints psi '0.000' for counts of 1 to 3 in a dB table. Carve-out mic-units-mixed accepts a mic field when every cell SFM disagrees with is SFM's own value in the other unit: 19 DL2 events (14 sample tables, 5 peaks); a cell matching neither stays a mismatch. Not a decoder change: SFM's mic data were right. Checker run 20261109-141808: 78 of 88 fields, 0 regressions; no mic peak or mic sample table mismatches left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
This commit is contained in:
1 parent
e21d23a3f2
commit
0b6150adb5
9 files changed
+25513
-4
No files matched your search
@@ -505,3 +505,42 @@ def test_a_range_1_mic_matches_blastware():
|
||||
res = {r.field: r for r in compare(sfm_side(path.read_bytes()), ref, CARVEOUTS)}
|
||||
for f in ("MicLPSPL", "samples.MicL"):
|
||||
assert res[f].verdict == "match", (f, res[f])
|
||||
|
||||
|
||||
# ── The unit Blastware printed, field by field (2026-11-09) ─────────────────
|
||||
# A report's event Units line does not always say what its mic values are in:
|
||||
# 7 DL2 reports print the mic peak in dB under a psi line, 3 the reverse, and
|
||||
# S353JTHU prints its sample table in dB under psi on both. The peak carries
|
||||
# its own unit, and a mic table's cells are unmistakable (dB >= 60, psi < 1).
|
||||
_UL = FIX.parent / "mic-units-11-09-26"
|
||||
|
||||
|
||||
def _res(path, side=None):
|
||||
ref = parse_xml_report_file(path.with_name(path.name.replace(".", "_", 1) + "_XML.XML"))
|
||||
return {r.field: r for r in compare(side or sfm_side(path.read_bytes()), ref, CARVEOUTS)}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path,field", [
|
||||
(_UL / "K441L9IN.OT0W", "MicLPSPL"), # psi line; the peak in dB, saying so
|
||||
(_UL / "K888JOU7.8K0H", "MicLPSPL"), # the same on a histogram
|
||||
])
|
||||
def test_a_mic_peak_is_read_in_its_own_unit(path, field):
|
||||
assert _res(path)[field].verdict == "match", _res(path)[field]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", [
|
||||
_UL / "K441L9IN.OT0W", # a dB table with psi cells ("0.000", "-0.000") for counts of 1 to 3
|
||||
_UL / "S353JTHU.DT0W", # psi rows, then dB rows, all under a psi line
|
||||
])
|
||||
def test_a_mic_column_mixing_dB_and_psi_is_accepted(path):
|
||||
r = _res(path)["samples.MicL"]
|
||||
assert (r.verdict, r.carveout) == ("accepted", "mic-units-mixed"), r
|
||||
|
||||
|
||||
def test_the_mixed_units_carveout_needs_every_cell_in_one_unit_or_the_other():
|
||||
path = _UL / "S353JTHU.DT0W"
|
||||
ref = parse_xml_report_file(path.with_name(path.name.replace(".", "_", 1) + "_XML.XML"))
|
||||
i = ref.channels.index("MicL")
|
||||
ref.sample_rows[0][i] = "50.00" # neither SFM's dB nor its psi
|
||||
res = {r.field: r for r in compare(sfm_side(path.read_bytes()), ref, CARVEOUTS)}
|
||||
assert res["samples.MicL"].verdict == "mismatch"
|
||||
Reference in new issue
Block a user