feat(checker): a histogram row printing one unit in both mic columns is the mixed-units case
The ~20 histograms with one mic interval off were Blastware printing the same number in both mic columns of a row: I145HKWT.DY0H row 672 reads 95.92 under psi(L) and dB(L) (count 5: dB), S353K894.OE0H rows 106 and 608 read 0.000 under both (count 2: psi). SFM's count agrees with the neighbouring rows and with the other column. mic-units-mixed now covers the interval mic columns too; a column names its own unit. 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
0b6150adb5
commit
6818e3023e
6 files changed
+4779
-3
No files matched your search
@@ -177,7 +177,9 @@ def _mic_units_mixed(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
|
||||
peak = max((abs(c) for c in counts), default=None)
|
||||
return alt is not None and peak is not None and not _differs(alt(peak), res.bw or "")
|
||||
got = series_pairs(sfm, ref, res.field)
|
||||
alt = _other_mic_unit(sfm, _mic_table_units(ref))
|
||||
# An interval column names its own unit; a sample table says it in its cells.
|
||||
units = res.field if res.field.startswith("intervals.") else _mic_table_units(ref)
|
||||
alt = _other_mic_unit(sfm, units)
|
||||
if got is None or got[1] or alt is None:
|
||||
return False
|
||||
differing = [(j, cell) for j, cell, v in got[0] if _differs(v, cell)]
|
||||
@@ -187,13 +189,16 @@ def _mic_units_mixed(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
|
||||
|
||||
MIC_UNITS_MIXED = Carveout(
|
||||
id="mic-units-mixed",
|
||||
fields=("MicLPSPL", "samples.MicL"),
|
||||
fields=("MicLPSPL", "samples.MicL", "intervals.MicL Peak psi(L)", "intervals.MicL Peak dB(L)"),
|
||||
evidence=("Blastware's dB(L) / psi(L) labels do not hold for the mic on every report: 7 DL2 "
|
||||
"reports print the mic peak in dB under a psi line, 3 the reverse, and some mix the "
|
||||
"two inside one column -- K441L9IN.OT0W prints psi '0.000' / '-0.000' for counts of 1 "
|
||||
"to 3 in a dB table, S353JTHU.DT0W psi rows then dB rows. On 19 DL2 events (14 "
|
||||
"sample tables, 5 peaks) every mic cell SFM disagrees with is SFM's own value in the "
|
||||
"other unit; a cell matching neither is still a mismatch. 2026-11-09."),
|
||||
"other unit; a cell matching neither is still a mismatch. A histogram row can print "
|
||||
"one unit in both its mic columns: I145HKWT.DY0H row 672 reads 95.92 under psi(L) "
|
||||
"and dB(L) (count 5, dB), S353K894.OE0H rows 106 and 608 0.000 under both (count 2, "
|
||||
"psi). 2026-11-09."),
|
||||
applies=_mic_units_mixed,
|
||||
)
|
||||
|
||||
|
||||
BIN
Binary file not shown.
+2264
File diff suppressed because it is too large.
Load diff
BIN
Binary file not shown.
+2498
File diff suppressed because it is too large.
Load diff
@@ -544,3 +544,12 @@ def test_the_mixed_units_carveout_needs_every_cell_in_one_unit_or_the_other():
|
||||
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"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path,column", [
|
||||
(_UL / "I145HKWT.DY0H", "MicL Peak psi(L)"), # row 672: 95.92 in both mic columns (count 5: dB)
|
||||
(_UL / "S353K894.OE0H", "MicL Peak dB(L)"), # rows 106, 608: 0.000 in both (count 2: psi)
|
||||
])
|
||||
def test_an_interval_printing_one_unit_in_both_mic_columns_is_accepted(path, column):
|
||||
r = _res(path)[f"intervals.{column}"]
|
||||
assert (r.verdict, r.carveout) == ("accepted", "mic-units-mixed"), r
|
||||
Reference in new issue
Block a user