fix(leakage): accept display flow units

This commit is contained in:
2026-07-17 11:45:58 +08:00
parent 2b5f9b8514
commit a204980944
2 changed files with 29 additions and 7 deletions
+9 -7
View File
@@ -121,13 +121,15 @@ def _worker_evaluate(raw_ratios: np.ndarray) -> float:
_cleanup_temp_files(prefix)
class LeakageIdentifier:
FLOW_UNIT_TO_M3S = {
"m3/s": 1.0,
"m3/h": 1.0 / 3600.0,
"L/s": 1.0 / 1000.0,
"L/min": 1.0 / 60000.0,
}
class LeakageIdentifier:
FLOW_UNIT_TO_M3S = {
"m3/s": 1.0,
"m³/s": 1.0,
"m3/h": 1.0 / 3600.0,
"m³/h": 1.0 / 3600.0,
"L/s": 1.0 / 1000.0,
"L/min": 1.0 / 60000.0,
}
@classmethod
def _flow_to_m3s(cls, value: float, unit: str) -> float: