From 80cface27c2baf6f209bbcdddd2e4d30ca3e96c4 Mon Sep 17 00:00:00 2001 From: jepegit Date: Fri, 26 Jun 2026 11:13:57 +0200 Subject: [PATCH] test: add CellpyLimits to cellpy-core parity contract (STEP-08) CellpyLimits (step-type detection thresholds) is now mirrored in cellpycore.legacy, so include it in the field-for-field parity test alongside the headers/units classes to guard against silent drift. Co-authored-by: Cursor --- tests/test_core_settings_parity.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/test_core_settings_parity.py b/tests/test_core_settings_parity.py index c34b5dea..856c7d34 100644 --- a/tests/test_core_settings_parity.py +++ b/tests/test_core_settings_parity.py @@ -1,11 +1,12 @@ -"""Contract tests guarding header/unit parity between cellpy and cellpy-core. +"""Contract tests guarding header/unit/limit parity between cellpy and cellpy-core. ``cellpy-core`` keeps verbatim copies of cellpy's authoritative settings classes -(``HeadersNormal``, ``HeadersSummary``, ``HeadersStepTable``, ``CellpyUnits``) in -``cellpycore.legacy`` so the integration seam (issue #377) produces identical column -names and units. These tests assert the copies stay field-for-field identical to +(``HeadersNormal``, ``HeadersSummary``, ``HeadersStepTable``, ``CellpyUnits``, +``CellpyLimits``) in ``cellpycore.legacy`` so the integration seam (issue #377) +produces identical column names, units, and step-type detection thresholds. These +tests assert the copies stay field-for-field identical to ``cellpy.parameters.internal_settings`` so drift in one repo fails loudly instead of -silently mismatching columns/units. See issue #378. +silently mismatching columns/units/limits. See issue #378. The whole module is skipped when ``cellpy-core`` is not installed. """ @@ -19,13 +20,14 @@ from cellpy.parameters import internal_settings as cellpy_settings # Classes that cellpy-core copies verbatim and must stay in sync with cellpy. -# NOTE: ``CellpyLimits`` is intentionally NOT yet ported to cellpy-core (the -# step-table port passes raw limits by value), so it is excluded here until ported. +# ``CellpyLimits`` (step-type detection thresholds) was ported to cellpy-core as part +# of STEP-08 and is now guarded here too. SHARED_CLASSES = [ "HeadersNormal", "HeadersSummary", "HeadersStepTable", "CellpyUnits", + "CellpyLimits", ]