feat: introduce family_spec logic for wafer sensor-count partitioning
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# ===== Wafer Sub-package =====
|
# ===== Wafer Sub-package =====
|
||||||
|
from pygui.backend.wafer.family_spec import sensor_count_for
|
||||||
from pygui.backend.wafer.wafer_layouts import available_families, load_layout
|
from pygui.backend.wafer.wafer_layouts import available_families, load_layout
|
||||||
from pygui.backend.wafer.zwafer_models import DataRecord, Sensor, ZWaferData
|
from pygui.backend.wafer.zwafer_models import DataRecord, Sensor, ZWaferData
|
||||||
from pygui.backend.wafer.zwafer_parser import ZWaferParser
|
from pygui.backend.wafer.zwafer_parser import ZWaferParser
|
||||||
@@ -7,4 +8,5 @@ __all__ = [
|
|||||||
"ZWaferData", "Sensor", "DataRecord",
|
"ZWaferData", "Sensor", "DataRecord",
|
||||||
"ZWaferParser",
|
"ZWaferParser",
|
||||||
"load_layout", "available_families",
|
"load_layout", "available_families",
|
||||||
|
"sensor_count_for",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
"""Single source of truth for the wafer sensor-count partition."""
|
||||||
|
|
||||||
|
|
||||||
|
def sensor_count_for(family_code: str) -> int:
|
||||||
|
"""Return the number of valid sensor readings for a wafer family code.
|
||||||
|
|
||||||
|
Returns 80 for the "X" family. Returns 244 for every other family
|
||||||
|
code."""
|
||||||
|
return 80 if family_code == "X" else 244
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
"""Tests for the shared wafer family sensor-count lookup."""
|
||||||
|
from pygui.backend.wafer.family_spec import sensor_count_for
|
||||||
|
|
||||||
|
|
||||||
|
def test_x_family_returns_80():
|
||||||
|
assert sensor_count_for("X") == 80
|
||||||
|
|
||||||
|
|
||||||
|
def test_p_family_returns_244():
|
||||||
|
assert sensor_count_for("P") == 244
|
||||||
|
|
||||||
|
|
||||||
|
def test_other_known_families_return_244():
|
||||||
|
for code in ("A", "B", "C", "D", "E", "F"):
|
||||||
|
assert sensor_count_for(code) == 244
|
||||||
|
|
||||||
|
|
||||||
|
def test_unknown_family_returns_244():
|
||||||
|
assert sensor_count_for("Z") == 244
|
||||||
|
|
||||||
|
|
||||||
|
def test_empty_string_returns_244():
|
||||||
|
assert sensor_count_for("") == 244
|
||||||
Reference in New Issue
Block a user