feat(map): add edge-center delta stats, thickness overlay, and layout fix
- Add edge-center sensor pair tables and delta calculations per wafer family. - Parse and interpolate wafer thickness CSV data for offscreen visualization. - Refactor ReadoutPanel layout using Item + anchors to fix right-margin clipping. - Compact E-C Delta text format to fit standard sidebar width. - Add pytest suite covering delta calculations, layout pairs, and thickness CSV.
This commit is contained in:
@@ -248,3 +248,47 @@ def test_on_live_frame_emits_trend_delta_with_elapsed_seconds(controller, monkey
|
||||
elapsed, avg = payload[0]
|
||||
assert elapsed == pytest.approx(2.5)
|
||||
assert avg == pytest.approx(20.0)
|
||||
|
||||
|
||||
# ---- edge-center stats exposure (ADR-0002) ----
|
||||
|
||||
def _write_f_family_csv(path):
|
||||
"""22-sensor F-family stream: pair (0,18) has delta 1.0, all others 0."""
|
||||
n = 22
|
||||
values = [149.0] * n
|
||||
values[0] = 150.0
|
||||
lines = [
|
||||
"Wafer ID=F12",
|
||||
"Acquisition Date=03/26/2025",
|
||||
"Label," + ",".join(str(i + 1) for i in range(n)),
|
||||
"X (mm)," + ",".join(str(i) for i in range(n)),
|
||||
"Y (mm)," + ",".join(str(i) for i in range(n)),
|
||||
"data",
|
||||
"0.0," + ",".join(f"{v:.1f}" for v in values),
|
||||
]
|
||||
path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
||||
|
||||
|
||||
def test_stats_include_edge_center_for_known_family(controller, tmp_path):
|
||||
csv = tmp_path / "f_run.csv"
|
||||
_write_f_family_csv(csv)
|
||||
controller.loadFile(str(csv))
|
||||
s = controller.stats
|
||||
assert s["ecMaxDelta"] == pytest.approx(1.0)
|
||||
assert s["ecMaxEdgeIndex"] == 1 and s["ecMaxCenterIndex"] == 19 # 1-origin
|
||||
assert s["ecMaxEdgeValue"] == pytest.approx(150.0)
|
||||
assert s["ecMaxCenterValue"] == pytest.approx(149.0)
|
||||
assert s["ecMinDelta"] == pytest.approx(0.0)
|
||||
|
||||
|
||||
def test_stats_edge_center_skips_replaced_sensor(controller, tmp_path):
|
||||
csv = tmp_path / "f_run.csv"
|
||||
_write_f_family_csv(csv)
|
||||
controller.loadFile(str(csv))
|
||||
controller.replaceSensor(0, 149.0) # replaced: pair (0,18) must be skipped
|
||||
assert controller.stats["ecMaxDelta"] == pytest.approx(0.0)
|
||||
|
||||
|
||||
def test_stats_edge_center_absent_for_unknown_or_short_family(controller):
|
||||
controller.loadFile("tests/fixtures/sample_stream.csv") # A12, 3 sensors
|
||||
assert "ecMaxDelta" not in controller.stats
|
||||
|
||||
Reference in New Issue
Block a user