From f2435244363d17edd1c224db27e660220be4c204 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 26 Oct 2026 03:23:00 +0900 Subject: [PATCH] =?UTF-8?q?feat(E03):=20analyze=5Fstation=20=EC=97=90=20gr?= =?UTF-8?q?oundwater=5Ffor(condition,=20model)=20=EC=9D=B8=EC=9E=90=20?= =?UTF-8?q?=E2=80=94=20=EC=A1=B0=EA=B1=B4=EB=A7=88=EB=8B=A4=20=EB=AA=A8?= =?UTF-8?q?=ED=98=95=20=EC=A7=80=ED=95=98=EC=88=98=20=EA=B0=88=EC=95=84=20?= =?UTF-8?q?=EB=81=BC=EC=9B=80=20=C2=B7=20None=20=EC=9D=B4=EB=A9=B4=20?= =?UTF-8?q?=EA=B7=B8=EB=8C=80=EB=A1=9C=20(532-2=202=EC=B0=A8=20=E2=91=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 시험: 건기 그대로 · 우기 r_u 0.3 이 지표 포화보다 안전율 높음 Co-Authored-By: Claude Opus 5.5 --- .../E03_StabSection_Engine_Station.py | 7 ++++++ .../tester/test_532_4_stab_walls_water.py | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/E03_StabSection/E03_StabSection_Engine_Station.py b/E03_StabSection/E03_StabSection_Engine_Station.py index dbfdae283..79da300be 100644 --- a/E03_StabSection/E03_StabSection_Engine_Station.py +++ b/E03_StabSection/E03_StabSection_Engine_Station.py @@ -8,6 +8,7 @@ import time from E03_StabSection.E03_StabSection_Engine_Model import section_model_from_b06 from E03_StabSection.E03_StabSection_Engine_Search import METHODS, analyze +from E03_StabSection.E03_StabSection_Types import groundwater as norm_groundwater #: 활동면 최소 깊이(m) — 지표를 얇게 긁는 면(표토 박리)은 사면 붕괴로 보지 않음. MIN_DEPTH_M = 0.3 @@ -26,10 +27,14 @@ def analyze_station( noncircular: bool = True, min_depth: float = MIN_DEPTH_M, case_workers: int = 1, + groundwater_for=None, **model_kw, ) -> dict: """측점 하나 — case_workers > 1 이면 비탈 × 조건 경우를 프로세스로 나눠 돎(측점 하나만 다시 셀 때). + groundwater_for(condition, model) → 엔진 지하수 꼴 — 주면 조건마다 모형 지하수를 갈아 끼움 + (E02 `station_groundwater` 꼴) · None 이면 모형 기본(우기 = 지표 수위). + 서버 프로세스 안에서는 1(차례로) 그대로 둠 — 자식이 main.py 를 다시 읽음(`Worker` 머리글). """ t0 = time.perf_counter() @@ -46,6 +51,8 @@ def analyze_station( seismic_kh=seismic_kh if cond == "seismic" else 0.0, **model_kw, ) + if groundwater_for is not None: + model["groundwater"] = norm_groundwater(groundwater_for(cond, model)) out.setdefault("areas", model["areas"]) jobs += [(cond, model, side) for side in model["sides"]] kw = {"methods": methods, "noncircular": noncircular, "min_depth": min_depth} diff --git a/resources/tester/test_532_4_stab_walls_water.py b/resources/tester/test_532_4_stab_walls_water.py index 4b688811b..86bb68eb5 100644 --- a/resources/tester/test_532_4_stab_walls_water.py +++ b/resources/tester/test_532_4_stab_walls_water.py @@ -238,6 +238,28 @@ def test_지하수_측점_모형에_끼움(): assert res["methods"]["bishop"]["min"]["F"] > 0 # 끼운 모형이 엔진에서 돎 +def test_측점_해석_groundwater_for_인자(): + ground = ground_model.build_initial(ground_model.load_defaults(), []) + ground["groundwater"].update(wet_mode="ru", ru=0.3) + seen = [] + + def gw_for(cond, model): + seen.append(cond) + return ground_model.station_groundwater(ground, cond, model) + + kw = {"conditions": ("dry", "wet"), "methods": ("bishop",), "noncircular": False} + base = analyze_station(CROSS, DESIGN, **kw) + out = analyze_station(CROSS, DESIGN, groundwater_for=gw_for, **kw) + assert seen == ["dry", "wet"] + F = {(c["condition"], c["side"]): c["min_F"]["bishop"] for c in out["cases"]} + F0 = {(c["condition"], c["side"]): c["min_F"]["bishop"] for c in base["cases"]} + for (cond, side), f in F.items(): + if cond == "dry": + assert f == pytest.approx(F0[cond, side]) # 건기 = 수위 없음 그대로 + else: + assert f > F0[cond, side] # r_u 0.3 < 지표 포화 + + @pytest.fixture def project(tmp_path, monkeypatch): async def fake_project(_project_id):