"""갈래마다 밑수가 다른 표 — 2026-09-15 브레인(헬기 착수 전 바로잡기). 8-6-1 유인헬기방제 표(F0225)는 「소형헬기 (160ha당)」·「대형헬기 (400ha당)」 갈래마다 밑수가 다른데, 2단 머리 표 읽기(`_match_two_row_table`)가 **밑수로 아예 안 나눠** 제목 단위 「ha」 에 160ha·400ha 몫이 그대로 앉아 있었음(160배·400배 부풂). 표 밑수가 한 벌(160ha)로만 잡혀 대형 400ha 도 못 가름. ⇒ 갈래 이름의 「(N단위당)」 이 있으면 그 밑수로, 없으면 표 밑수로 나눔. 그 길을 지나는 표 다섯 중 밑수가 1 이 아닌 표는 8-6-1 하나 · 갈래마다 밑수가 다른 표도 전체에서 8-6-1 하나. """ from __future__ import annotations from decimal import Decimal from B09_Estimation.B09_Estimation_UnitPrice import cached_build def _labor(book, title: str) -> dict[str, Decimal]: return { book.titles[r.ref_code].name: r.quantity for r in book.details[title] if r.ref_code in ("1002", "1003") } def test_유인헬기_인력은_갈래_밑수로_나눈_ha당() -> None: book = cached_build().book small = _labor(book, "B-FP-08-06-01#소형헬기(160ha당)") assert ( small["특별인부"] == Decimal("0.8") / 160 and small["보통인부"] == Decimal("8.2") / 160 ), small large = _labor(book, "B-FP-08-06-01#대형헬기(400ha당)") assert ( large["특별인부"] == Decimal("2.1") / 400 and large["보통인부"] == Decimal("13.4") / 400 ), large def test_밑수_1_인_2단_표는_그대로() -> None: book = cached_build().book rows = [r for t in book.titles if t.startswith("B-FP-12-03#") for r in book.details[t]] assert rows and all(r.quantity < 20 for r in rows) # 철근 가공·조립 ton당 — 나누기 전과 같음