refactor(backend)!: separate algorithm and data layers

Reorganize algorithm packages by business responsibility, move orchestration into services, and keep database access behind pooled repositories.

Harden analysis API validation, remove unsafe legacy simulation endpoints, and add regression and architecture boundary coverage.

BREAKING CHANGE: legacy algorithm module paths and obsolete simulation endpoints are removed.
This commit is contained in:
2026-09-04 17:30:55 +08:00
parent 9b095c7439
commit 5966d039de
91 changed files with 1418 additions and 4020 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
from typing import Any
from app.algorithms.isolation.valve import valve_isolation_analysis
from app.algorithms.valve_isolation.topology_search import valve_isolation_analysis
from app.native.wndb.gis.network_views import get_network_link_nodes
def analyze_valve_isolation(
@@ -8,4 +9,5 @@ def analyze_valve_isolation(
accident_element: str | list[str],
disabled_valves: list[str] = None,
) -> dict[str, Any]:
return valve_isolation_analysis(network, accident_element, disabled_valves)
link_entries = get_network_link_nodes(network)
return valve_isolation_analysis(link_entries, accident_element, disabled_valves)