fix(burst): recognize native pressure units and separate isolation impact
This commit is contained in:
@@ -104,3 +104,17 @@ def resolve_overlay(snapshot: TaskDataSnapshot, mode: str) -> dict:
|
||||
normalized["properties"]["weight"] = weight
|
||||
features.append(normalized)
|
||||
return {"type": "FeatureCollection", "features": features}
|
||||
|
||||
|
||||
def validate_overlay_stage(data: dict, stage: str | None) -> None:
|
||||
"""An event-impact claim must be supported by the saved scenario geometry."""
|
||||
if stage != "event_impact":
|
||||
return
|
||||
features = data.get("features", [])
|
||||
require(bool(features) and all(
|
||||
(feature.get("properties") or {}).get("impact_phase") in {
|
||||
"after_burst_before_intervention", "after_contamination_before_intervention",
|
||||
} for feature in features
|
||||
), "OVERLAY_IMPACT_PHASE_MISMATCH",
|
||||
"事件影响阶段须引用处置前情景覆盖;关阀及供水失源覆盖请使用 isolation_plan,不能替代不可用的事件降压结果",
|
||||
status=422)
|
||||
|
||||
Reference in New Issue
Block a user