重构 app/algorithms/api_ex 目录结构

This commit is contained in:
2026-03-09 17:26:39 +08:00
parent 48f836d667
commit 0b72ac959a
30 changed files with 364 additions and 968 deletions
@@ -8,20 +8,12 @@ import sys
import pandas as pd
import wntr
from app.algorithms._utils import _cleanup_temp_files
_PIPE2LEAKNODE = None
_SIGNATURE_WORKER_DATA = {}
def _cleanup_temp_files(prefix):
for ext in [".inp", ".rpt", ".bin", ".out"]:
temp_file = prefix + ext
if os.path.exists(temp_file):
try:
os.remove(temp_file)
except OSError:
pass
def _make_temp_prefix(tag):
temp_dir = os.path.abspath(os.path.join("temp", "burst_location"))
os.makedirs(temp_dir, exist_ok=True)