feat(workflows): Update CI configuration and enhance testing conditions
- Added workflow_run triggers for "Deploy Development" and "Deploy Production" to ensure tests run only after successful deployments. - Updated Python version in CI from 3.12 to 3.11 for better compatibility with the Debian 12 ARM64 runner. - Enhanced job conditions to skip tests on failed workflow runs. - Improved frontend build process by updating Node.js setup and ensuring correct directory navigation. - Refined CSV parsing logic to handle custom and unknown source units, enhancing conversion flexibility. - Added new tests for custom source unit handling in CSV conversions, ensuring accurate processing.
This commit is contained in:
1 parent
d6d7e738a5
commit
0d0ab62674
5 files changed
+53
-9
No files matched your search
@@ -83,12 +83,17 @@ def factor_source_to_canonical(module: str, db_field: str, source_unit: str | No
|
||||
"""
|
||||
Multiplikator: CSV-Zahl * Faktor → Wert in kanonischer DB-Einheit.
|
||||
Unbekannte/None/leer/Passthrough → 1.0
|
||||
|
||||
``source_unit`` ``custom`` / ``none``: kein Registry-Faktor (1.0); freie Skalierung nur über
|
||||
``conversion_factor`` in type_conversions (JSON).
|
||||
"""
|
||||
if source_unit is None:
|
||||
return 1.0
|
||||
su = str(source_unit).strip().lower()
|
||||
if not su:
|
||||
return 1.0
|
||||
if su in ("custom", "none"):
|
||||
return 1.0
|
||||
cu = get_canonical_unit(module, db_field)
|
||||
if not cu:
|
||||
return 1.0
|
||||
|
||||
Reference in new issue
Block a user