feat(E03): 판정 면 칸(원호 · 비원호 · 면 확인 · 모형 끝 면) + 탐색 한계 고르기 (PLAN 567-1)
- 목록 판정 면 칸 · 결과 방법 줄 · 면 확인 · 모형 끝 면 배지 - 해석 설정 탐색 한계(모형 끝 / 비탈 끝 + 2H / 비탈 끝 + 정한 m) — [해석] 이 저장 + 그 값으로 셈 - Router 설정 저장본 · 지문 · 일꾼 kwargs · 단면 · 가정 · 확률 길 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,11 +69,13 @@ def frozen():
|
||||
|
||||
|
||||
CALLS: list[float] = []
|
||||
REACHES: list[object] = []
|
||||
|
||||
|
||||
def _fake_analyze(cross, design, *, layers=None, ground=None, conditions=("dry", "wet"), **kw):
|
||||
"""엔진 출력 꼴 그대로 · 값은 누가거리로 정함(1.0 + ch/100 · 건기 +0.3)."""
|
||||
CALLS.append(float(cross["chainage_m"]))
|
||||
REACHES.append(kw.get("search_reach"))
|
||||
model = section_model_from_b06(
|
||||
cross, design, layers=layers, ground=ground, materials=kw.get("materials")
|
||||
)
|
||||
@@ -209,6 +211,33 @@ def test_지문이_같으면_다시_안셈(project):
|
||||
assert body["fresh"] and any(v["required"] == 9.0 and v["ok"] is False for v in fill_dry)
|
||||
|
||||
|
||||
def test_탐색_한계는_저장되고_지문이_바뀜(project):
|
||||
first = _analyze()
|
||||
assert set(REACHES) == {"model_end"}
|
||||
body = asyncio.run(router.result2d(UUID(PID), USER))
|
||||
assert body["search_reach"] == "model_end"
|
||||
|
||||
async def go(reach):
|
||||
out = await router.analyze2d(UUID(PID), router.AnalyzeRequest(search_reach=reach))
|
||||
while router._TASKS:
|
||||
await asyncio.gather(*list(router._TASKS))
|
||||
return out
|
||||
|
||||
REACHES.clear()
|
||||
second = asyncio.run(go("2h"))
|
||||
assert second["status"] == "accepted" and second["fingerprint"] != first["fingerprint"]
|
||||
assert set(REACHES) == {"2h"} and len(REACHES) == N_STATIONS
|
||||
assert asyncio.run(router.result2d(UUID(PID), USER))["search_reach"] == "2h"
|
||||
assert asyncio.run(go(None))["status"] == "fresh" # 값 없음 = 저장값 그대로
|
||||
REACHES.clear()
|
||||
assert asyncio.run(go(12.5))["status"] == "accepted" and set(REACHES) == {12.5}
|
||||
assert asyncio.run(router.result2d(UUID(PID), USER))["search_reach"] == 12.5
|
||||
asyncio.run(go("model_end"))
|
||||
assert (
|
||||
router.plan_run(project, router._ground(project))["fp"] == first["fingerprint"]
|
||||
) # 기본 = 옛 지문
|
||||
|
||||
|
||||
def test_진행률_올라감(project, monkeypatch):
|
||||
seen = []
|
||||
|
||||
@@ -446,6 +475,7 @@ process.stdout.write(JSON.stringify({
|
||||
zAt: [m.zAt([[0, 0], [10, 10]], 2.5), m.zAt([[10, 10], [0, 0]], -5)],
|
||||
stride: [m.labelStride(100, 64), m.labelStride(40, 64), m.labelStride(10, 64), m.labelStride(0.1, 64)],
|
||||
labels: [1, 2, 5].map((k) => m.planLabelKeys(input.rows, 20, k, null)),
|
||||
basis: input.basisRows.map((r) => m.basisOf(r, "dry")),
|
||||
labelsActive: [m.planLabelKeys(input.rows, 20, 5, "e"), m.planLabelKeys(input.rows, 20, 5, "b")],
|
||||
}));
|
||||
"""
|
||||
@@ -500,7 +530,28 @@ def test_logic_TS():
|
||||
"pore_pressure": 4.47,
|
||||
}
|
||||
fs_list = [None, 1.0, 1.2, 1.35, 1.5, 1.65, 1.875, 2.25, 9.0]
|
||||
payload = {"rows": rows, "view": sec, "fsList": fs_list, "shape": shape, "slice": slice_row}
|
||||
|
||||
def side(fs, method, check=False, edge=None):
|
||||
return {"fs": fs, "method": method, "surface_check": check, "edge": edge}
|
||||
|
||||
basis_rows = [
|
||||
{
|
||||
"cases": {
|
||||
"dry": {"left": side(1.2, "bishop"), "right": side(2.0, "spencer", True, True)}
|
||||
}
|
||||
},
|
||||
{"cases": {"dry": {"left": side(1.1, "morgenstern_price", True, False)}}},
|
||||
{"cases": {"dry": {"left": {"fs": 1.5}}}}, # 옛 저장본 — 새 칸 없음
|
||||
{"cases": {}},
|
||||
]
|
||||
payload = {
|
||||
"basisRows": basis_rows,
|
||||
"rows": rows,
|
||||
"view": sec,
|
||||
"fsList": fs_list,
|
||||
"shape": shape,
|
||||
"slice": slice_row,
|
||||
}
|
||||
proc = subprocess.run(
|
||||
["node", "-e", SCRIPT, str(TYPESCRIPT), str(TS)],
|
||||
input=json.dumps(payload),
|
||||
@@ -577,6 +628,13 @@ def test_logic_TS():
|
||||
)
|
||||
assert out["ticks"][0] <= -3 and out["ticks"][-1] >= 47 and 0 in out["ticks"]
|
||||
assert out["zAt"] == [2.5, 0]
|
||||
# 판정 면 칸 — 가장 낮은 비탈의 방법 · 면 확인 · 모형 끝 면은 비탈 하나라도
|
||||
assert out["basis"] == [
|
||||
{"method": "bishop", "circular": True, "surfaceCheck": True, "edge": True},
|
||||
{"method": "morgenstern_price", "circular": False, "surfaceCheck": True, "edge": False},
|
||||
{"method": None, "circular": None, "surfaceCheck": False, "edge": False},
|
||||
{"method": None, "circular": None, "surfaceCheck": False, "edge": False},
|
||||
]
|
||||
# 평면 띠 측점 글 솎음 — 간격 px × 걸음 ≥ 64 · 본 측점 중 걸음 배수 · 고른 측점은 늘
|
||||
assert out["stride"] == [1, 2, 10, 100]
|
||||
assert out["labels"] == [["a", "b", "c", "d", "e"], ["a", "c", "e"], ["a"]]
|
||||
|
||||
Reference in New Issue
Block a user