接入力标定 schema 3 与多点空间增益模型
保留旧格式和 cal_path,校验 SN、特征身份及坐标附件,按帧返回逐轴状态。相关测试 263 项通过,已核对存量预测并实测 180 帧录像。
This commit is contained in:
@@ -119,12 +119,13 @@ def resolve_calibration(
|
||||
)
|
||||
|
||||
if mode is CalibrationSelection.EXPLICIT:
|
||||
path = explicit
|
||||
path = cal_mod.select_calibration_path(cal_path=explicit)
|
||||
else:
|
||||
path = declared_default
|
||||
if path is None:
|
||||
fallback = bundle_root / "force_calibration.json"
|
||||
path = fallback if fallback.is_file() else None
|
||||
path = cal_mod.select_calibration_path(default_path=path)
|
||||
|
||||
if path is None:
|
||||
# Not an error: a profile may legitimately ship no calibration. Calibrated force is
|
||||
@@ -197,6 +198,12 @@ def resolve_calibration(
|
||||
|
||||
identity = _identity_of(document)
|
||||
declared_type = str(identity.get("sensor_type") or "")
|
||||
if document.schema_version == 3 and declared_type != product_family:
|
||||
return ResolvedCalibration(
|
||||
selection=mode, path=path,
|
||||
issues=(Issue(code="calibration.model-family-mismatch",
|
||||
message="selected model belongs to another product family", path=path),),
|
||||
)
|
||||
if declared_type:
|
||||
applicability = "declared"
|
||||
if declared_type != product_family:
|
||||
@@ -273,6 +280,8 @@ def calibration_fingerprint(document: "cal_mod.Calibration", path: Path) -> str:
|
||||
a different directory must produce the same fingerprint.
|
||||
"""
|
||||
try:
|
||||
if getattr(document, "schema_version", None) == 3:
|
||||
return document.fingerprint
|
||||
payload = document.to_dict()
|
||||
except Exception: # noqa: BLE001 - fall back to the raw bytes rather than fail
|
||||
payload = path.read_bytes().decode("utf-8", errors="replace")
|
||||
|
||||
Reference in New Issue
Block a user