Files
Aislo/resources/tester/test_54_26_slope_table09.py
T
eomsangdonandClaude Opus 5.5 cb7a140c10 feat(B06): 소단 = 좌측 깊이 칸 숨김 · 횡단도 소단 고름 ▲▼ 만 · 측점 · 쪽마다 깊이 patch · 고름 조각 키 · 좌측 소단 상자 켬(194-1 · 194-2)
- 정의 「상세 내용」 = 폭만 · depth_m 표시 끔(옛 구간 값 = 기본값으로 읽음 · 새 기본 1 m)
- 짝: BermSpec 쪽마다 깊이 · side_berm ↔ sideBerm · 설계 결과 berm_depth_{side}_m 되싣기(파이썬 ↔ TS)
- 저장: patch berm_depth_{side}_m(≥ 0) · 재계산 살림 목록 짝(RD ↔ CR) · 세션 bermdepth
- 서버 [저장] 다시 셈 = 구조물 정본 소단 구간(load_berm_spans) + 측점 깊이 · 구간 지우면 소단 없음
- 고름: 소단 수평 단 = 높이만(▲ 0 에서 멈춤 · ▼ 사면 끝 앞 멈춤 · ◀▶ 막힘) · 사면 = 가로 · 노면 = 종단
- 고름을 조각 키(갈래 + 쪽 + 차례)로 기억 — 옮겨 다시 그려도 같은 조각
- 새 시험 test_194_1_berm_depth + helper · test_178_2 · test_54_26 고침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3mdb91125mPoC6tpsQx4P
2026-10-10 13:59:43 +09:00

92 lines
3.4 KiB
Python

"""PLAN 54-26 — 사용자 구조물 표 09 사면안정 › 흙막이 · 옹벽 · 소단.
· 컨테이너 = 흙막이 「흙막이」 · 옹벽 「옹벽」 · 소단 「상세 내용」 — 칸은 표대로만 · 표 밖 옛 칸은 숨김(값 · 기본값 그대로)
· 흙막이 형태 = 배관 흙막이 6 · 옹벽 형태 = 콘크리트 하나(새 칸 `wall_form` · 옛 형식 `form` 값은 그대로 통과)
"""
import json
from pathlib import Path
from B05_Profile.B05_Profile_Structures_Repository import _validate_types
from B05_Profile.B05_Profile_Structures_Schema import (
DEFINITION_PATH,
StructureInstance,
load_structure_types,
)
from M02_MasterTemplete.StructOptions import M02_SO_Definition
from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of
from M02_MasterTemplete.StructOptions.M02_SO_Options import hidden_keys
TABLE = {
"soil_guard": (
"gsoilgdetail",
"흙막이",
["form", "length_m", "height_m", "before_m", "after_m"],
),
"retaining_wall": (
"gretaindetail",
"옹벽",
["wall_form", "length_m", "height_m", "before_m", "after_m"],
),
"berm": (
"gbermdetail",
"상세 내용",
["width_m"],
), # 높이 · 깊이 칸 숨김(깊이 = 횡단도 ▲▼ · 194-1)
}
SOIL_FORMS = ["돌쌓기(찰)", "돌쌓기(메)", "콘크리트", "돌망태", "통나무·목재틀", "바자"]
def _types():
return {t.type_id: t for t in load_structure_types()}
def test_컨테이너_하나_칸은_표대로_차례대로():
groups = groups_of()
types = _types()
hidden = hidden_keys()
for type_id, (gid, name, keys) in TABLE.items():
assert groups[type_id] == [{"id": gid, "name": name, "options": keys}]
options = [o.key for o in types[type_id].options]
assert options[: len(keys)] == keys # 칸 차례 = 표 차례
assert hidden[type_id] == set(options) - set(keys) # 표 밖 = 숨김(값은 남음)
def test_형태_선택지():
types = _types()
soil = {o.key: o for o in types["soil_guard"].options}
pipe = {o.key: o for o in types["pipe"].options}
assert soil["form"].choices == SOIL_FORMS == pipe["outlet_revet_form"].choices
assert soil["form"].phase == "b05" # B05 = B06
wall = {o.key: o for o in types["retaining_wall"].options}
assert wall["wall_form"].choices == ["콘크리트"]
assert "반중력식" in wall["form"].choices # 옛 형식 값 그대로 통과
doc = json.loads(Path(DEFINITION_PATH).read_text("utf-8"))
assert doc["종류"]["soil_guard"]["이름"]["form=통나무·목재틀"] == "통나무/목재틀"
def test_옛_값_저장_막지_않음():
def item(type_id, **options):
return StructureInstance(
type_id=type_id,
placement="interval",
chainage_m=20,
start_m=20,
end_m=30,
options={"length_m": 10, "before_m": 0, "after_m": 10, **options},
)
_validate_types(
[
item("soil_guard", height_m=2), # 형태 없는 옛 흙막이
item("retaining_wall", form="반중력식", height_m=2),
item("berm", width_m=0.5, interval_m=3, height_m=5),
]
)
def test_정의_검사_통과_판_이력():
doc = json.loads(Path(DEFINITION_PATH).read_text("utf-8"))
assert M02_SO_Definition.check(doc) == []
assert M02_SO_Definition.history_path(doc["판"] - 1).is_file()