From 04e041ee5c9259c95b71e35f00e9db1a5afe0848 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 27 Oct 2026 21:32:46 +0900 Subject: [PATCH] =?UTF-8?q?fix(564-1):=20=EC=B2=B4=EC=9D=B8=20=EA=B4=91?= =?UTF-8?q?=EC=97=AD=20=EB=8B=A8=EA=B3=84=20=3D=20E07=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EA=B3=BC=20=EA=B0=99=EC=9D=80=20=EC=A1=B0=EA=B1=B4(=EC=A7=80?= =?UTF-8?q?=EB=82=9C=20=EC=A1=B0=EA=B1=B4=20+=20=EC=A7=80=EA=B8=88=20E02?= =?UTF-8?q?=20=EB=AC=BC=EC=84=B1)=20=C2=B7=20=EC=A7=80=EB=AC=B8=EC=97=90?= =?UTF-8?q?=20E02=20=EB=AC=BC=EC=84=B1(564-4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 시험 test_564_1 — 광역 물성 E02 값 · 지문 같으면 건너뜀 Co-Authored-By: Claude Opus 5.5 --- E02_StabGround/E02_StabGround_Chain.py | 13 ++++++++++-- resources/tester/test_564_1_e02_chain.py | 27 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/E02_StabGround/E02_StabGround_Chain.py b/E02_StabGround/E02_StabGround_Chain.py index 31344ea71..ceea7172d 100644 --- a/E02_StabGround/E02_StabGround_Chain.py +++ b/E02_StabGround/E02_StabGround_Chain.py @@ -218,9 +218,18 @@ def build_steps(project_id: UUID, project_root: Path) -> dict[str, Step]: async def step_area(report: Report, _stopped: Stopped) -> str: src = e07._source_root(root) saved = await asyncio.to_thread(e07.load, root) - base = (saved or {}).get("settings") or e07.defaults(root) + # E07 화면과 같음 — 지난 조건(없으면 기본값) + 물성은 지금 E02 값(564-4) + base = {**e07.defaults(root), **((saved or {}).get("settings") or {})} + mat = e07.ground_material(root, base.get("material_id")) + if mat and mat["id"] == base.get("material_id"): + base.update({k: float(mat[k]) for k in e07.MATERIAL_KEYS}) + base.update(c_hi=base["c"] + e07.RANGE_C_KPA, phi_hi=base["phi"] + e07.RANGE_PHI_DEG) settings = e07.AreaRequest(**base).model_dump(exclude={"force"}) - finger = e07.fingerprint(source.manifest(src)["source_fingerprint"], settings) + finger = e07.fingerprint( + source.manifest(src)["source_fingerprint"], + settings, + e07.ground_material(root, settings["material_id"]), + ) if saved and saved["fingerprint"] == finger: return "skip" page = _plug(e07._JOBS, pid, {}) diff --git a/resources/tester/test_564_1_e02_chain.py b/resources/tester/test_564_1_e02_chain.py index a49e6f496..e16f1214c 100644 --- a/resources/tester/test_564_1_e02_chain.py +++ b/resources/tester/test_564_1_e02_chain.py @@ -253,3 +253,30 @@ def test_단계_상태_적기(monkeypatch): ("report", "skip"), ] assert marks[0] == ("2d", "run", None) and "area 망가짐" in marks[7][2] + + +def test_광역_물성은_E02_값_지문_같으면_건너뜀(tmp_path, monkeypatch): + from common_util.common_util_json import atomic_write_json + from E07_StabArea import E07_StabArea_Router as e07 + + ground = model.build_initial(model.load_defaults(), []) + colluvium = next(m for m in ground["materials"] if m["id"] == "colluvium") + colluvium["c"] = 7.0 + atomic_write_json(model.ground_path(tmp_path), ground) + old = {**e07.defaults(tmp_path), "c": 1.0, "c_hi": 2.0, "band_m": 150.0} + atomic_write_json(tmp_path / e07.RESULT, {"fingerprint": "옛", "settings": old}) + monkeypatch.setattr(e07, "_source_root", lambda root: root) + monkeypatch.setattr(source, "manifest", lambda src: {"source_fingerprint": "src"}) + runs = [] + + def fake_run(root, src, settings, finger, report): + runs.append(settings) + atomic_write_json(root / e07.RESULT, {"fingerprint": finger, "settings": settings}) + + monkeypatch.setattr(e07, "run", fake_run) + step = chain.build_steps(PID, tmp_path)["area"] + assert asyncio.run(step(lambda f, m: None, lambda: False)) == "done" + got = runs[0] + assert got["c"] == 7.0 and got["c_hi"] == 7.0 + e07.RANGE_C_KPA # 물성 = 지금 E02 + assert got["band_m"] == 150.0 # 그 밖 조건 = 지난 저장본 + assert asyncio.run(step(lambda f, m: None, lambda: False)) == "skip" and len(runs) == 1