- v16 「덤프 운반은 아직 안 선다」가 지키던 것 = 운반거리(설계 입력) 없이 운반이 조용히 금액을 갖지 않기
→ 「거리가 와야 선다」로: 거리 없는 기본 조립엔 운반(#L…m) 없음 · 거리 무관 적재(#적재)만 섬
- 갈래 제목 ⊂ 마스터 갈래 키: 10-12 는 표가 아니라 본문 식이라 마스터 표에 갈래가 없음
(#L…m 는 프로젝트 거리마다 생겨 마스터에 둘 수도 없음) → 식이 내는 FP-10-12 갈래만 까닭 적고 제외
- 58afe8f2 를 일부 시험만 돌리고 올려 난 빨강 · 전체 1763 통과
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
54 lines
2.5 KiB
Python
54 lines
2.5 KiB
Python
"""공종 마스터 갈래 키 `variant_key` — 표 읽기가 가른 대로 (명세 14장 정정 · 2026-09-13).
|
|
|
|
지키는 것
|
|
① 짝 시험 — 단가표의 `B-<코드>#<갈래>` 제목은 **전부** 그 공종의 마스터 갈래 키에 있다
|
|
(종전 첫 열 24개 방식은 294 중 86). 표 읽기를 고치고 마스터를 안 다시 뽑으면 여기서 걸림
|
|
② 머리행 갈래(벌목)·뭉친 이름 표(찰쌓기 장비)는 머리행에서 · 첫 열이 자원 이름인 표는 빈칸
|
|
③ 합산형 부모는 단계 갈래를 물려받음(흙깎기 리핑암 9-4 = 암질 + [주]① 평균)
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from B09_Estimation.B09_Estimation_ResourceAxis import load_work_item_master
|
|
from B09_Estimation.B09_Estimation_UnitPrice import cached_build, normalize_variant_key
|
|
|
|
|
|
def _nodes() -> dict[str, dict]:
|
|
return {node["work_item_code"]: node for node in load_work_item_master()["work_items"]}
|
|
|
|
|
|
def test_단가표_갈래_제목은_전부_마스터_갈래_키에_있다() -> None:
|
|
nodes = _nodes()
|
|
missing = []
|
|
for code in cached_build().book.titles:
|
|
if not code.startswith("B-") or "#" not in code:
|
|
continue
|
|
if code.startswith("B-FP-10-12-"):
|
|
# 덤프 운반·적재(10-12)는 **표가 아니라 본문 식**이라 마스터 표에 갈래가 없음 —
|
|
# 갈래(`#적재`·`#L…m`)는 식이 냄(2026-09-14 · `MachineProductivity_Dump`).
|
|
continue
|
|
work_item, variant = code[2:].split("#", 1)
|
|
keys = {
|
|
normalize_variant_key(k) for k in nodes.get(work_item, {}).get("variant_keys") or []
|
|
}
|
|
if variant not in keys:
|
|
missing.append(code)
|
|
assert not missing, f"마스터를 다시 뽑을 것(B08_Quantity_Build_WorkItemMaster): {missing[:5]}"
|
|
|
|
|
|
def test_표_모양대로_갈래를_가르고_못_가르면_빈칸() -> None:
|
|
nodes = _nodes()
|
|
felling = nodes["FP-04-02-02"]["tables"][0]["variant_key"]
|
|
assert "5m이상~8m미만" in felling # 머리행 갈래 — 첫 열(자원 이름)이 아님
|
|
assert nodes["FP-13-04-05"]["tables"][0]["variant_key"] == [
|
|
"35cm 이하",
|
|
"55cm 이하",
|
|
"75cm 이하",
|
|
]
|
|
finishing = next(t for t in nodes["FP-12-02"]["tables"] if t["pum_table_id"] == "F0334")
|
|
assert finishing["variant_key"] == [] # 첫 열이 자원 이름(미장공)인 표
|
|
|
|
|
|
def test_합산형_부모는_단계_갈래를_물려받는다() -> None:
|
|
assert _nodes()["FP-09-04"]["variant_keys"] == ["연암", "보통암", "경암", "평균"]
|