Files
Aislo/resources/tester/test_b09_variant_basis.py
eomsangdonandClaude Opus 5 e15e9fc223 fix(b09): 2단 머리 표가 밑수로 안 나누던 것 — 갈래 이름의 「(Nha당)」 밑수로 나눔(8-6-1 유인헬기 160배·400배 부풂)
· _match_two_row_table 이 표 밑수로 아예 안 나눠 제목 단위 ha 에 160ha·400ha 몫이 그대로 앉아 있었음
· 표 밑수가 한 벌뿐이라 갈래마다 다른 밑수(소형 160ha · 대형 400ha)도 못 가르던 병 → 갈래 이름이 제 밑수를 적으면 그것으로, 없으면 표 밑수로
· 그 길을 지나는 표 다섯 중 밑수가 1 이 아닌 것 8-6-1 하나 · 전체에서 갈래마다 밑수가 다른 표도 8-6-1 하나

8-6-1 소형 1,591,855 → 9,949원/ha · 대형 2,780,567 → 6,951 · 나머지 제목 그대로 · 잴 시험 빨강→초록 · 끄기 빨강 · 전체 시험 통과

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
2026-09-15 02:47:59 +09:00

41 lines
1.8 KiB
Python

"""갈래마다 밑수가 다른 표 — 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당 — 나누기 전과 같음