deduplication pass

This commit is contained in:
2026-04-03 18:19:08 -07:00
parent f6b47e6d79
commit c8d766677b
42 changed files with 484 additions and 689 deletions

View File

@@ -3,6 +3,7 @@ from __future__ import annotations
import numpy as np
from backend.data_types import DataField
from backend.nodes.helpers import _square_unit
def _level_data(data: np.ndarray, level: str) -> np.ndarray:
@@ -78,15 +79,6 @@ def _inverse_unit(unit: str) -> str:
return f"1/{text}"
def _square_unit(unit: str) -> str:
text = str(unit or "").strip()
if not text:
return ""
if text.isalnum() or text in {"m", "nm", "um", "pm", "V", "A", "Hz", "px"}:
return f"{text}^2"
return f"({text})^2"
def _product_unit(*units: str) -> str:
parts = [str(unit).strip() for unit in units if str(unit or "").strip()]
return " ".join(parts)