Files
Aislo/old_code/B09_Estimation/B09_Estimation_UnreadTables.py
T
eomsangdonandClaude Opus 5 8472fc9f40 refactor(B08,B09): 폴더째 old_code 로 옮기고 빈 화면 둘만 남김 (PLAN 7-3)
B08_Quantity 86 · B09_Estimation 111 파일을 old_code/ 로 옮김(지우지 않음).
화면은 메뉴·주소·단계 막대만 남은 빈 틀 둘 — main.py 라우터 13 개는 끊음.
B07 이 빌려 쓰던 비탈 길이·면적은 필요한 함수만 B07_DesignDetail_Engine_SlopeGeometry
로 옮겨 적음(면적 적분·노면 면적·측점 묶음은 안 옮김) · 시험 하나를 새로 둠.
B07 구조물도 조립(Cad_StandardSheet)은 2026-09-13 에 이미 도면 목록에서 빠져
부르는 곳이 없어 old_code 로 같이 보냄 — 구조물 그림은 되살리지 않음.
B06 구조물 몫 조회는 빈 값으로 두어 화면이 그대로 서게 함.
B08·B09 를 부르던 시험 25 개도 old_code/resources/tester 로 옮김.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAdA5ThqmtVSsbzjusk1cJ
2026-09-22 12:27:45 +09:00

43 lines
2.1 KiB
Python

"""B09 원가계산 — **사유 없이 버려지는 표에 사유를 남긴다** (2026-09-15 브레인 「버릴 때는 사유」).
일할 표(작업량·소요량·형식 미정)를 가진 잎 공종인데 제목도 사유도 없는 것 — 표를 읽는 길이 없어 한 줄도
안 서고 어디에도 안 남음(잰 수 49 · ㉯ 가르기에서 먼저 6). 내역서가 「일위대가가 아직 없습니다」 만 띄워
무엇을 손볼지 모름 → 표 번호·모양을 `component_gaps` 에 적음(내역서 「성분 미확보 — …」 로 섬).
⚠ 읽는 길을 만드는 것이 아님 — 그 표가 풀리면 제목이 서서 이 사유는 저절로 안 붙음.
"""
from __future__ import annotations
from typing import Any
#: 마스터 표 형식 → 사유에 쓰는 이름. 여기 없는 형식(참고·계수)은 일할 표가 아님.
FORM_LABELS = {
"productivity": "작업량 표",
"requirement": "소요량 표",
"undetermined": "형식 미정 표(모양 판정 안 됨)",
}
UNREAD = "표를 읽는 길이 없어 한 줄도 안 섬 — {tables}"
def mark_unread_tables(build: Any, master: dict[str, Any]) -> None:
"""제목·사유가 둘 다 없는 잎 공종에 표 번호·모양 사유를 단다."""
from B09_Estimation.B09_Estimation_KnownGaps import known_gap_note
nodes = master.get("work_items", [])
parents = {node.get("parent_code") for node in nodes}
titled = {code[2:].split("#")[0] for code in build.book.titles if code.startswith("B-")}
for node in nodes:
code = node["work_item_code"]
tables = [t for t in node.get("tables") or [] if t.get("pum_form") in FORM_LABELS]
if not tables or code in titled or code in parents:
continue
if (
build.unattached.get(code)
or build.component_gaps.get(code)
or code in build.basis_missing
or known_gap_note(code)
):
continue
listed = " · ".join(f"{t.get('pum_table_id')} {FORM_LABELS[t['pum_form']]}" for t in tables)
build.component_gaps[code] = UNREAD.format(tables=listed)