deduplication pass
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user