Files
Aislo/resources/tester/test_b09_formwork_use_count.py
T

56 lines
2.9 KiB
Python

"""합판거푸집 12-4 사용횟수별 비율 — 2026-09-14 브레인 ㉮ 승인.
원문 L6187~6211: 기준수량(1회사용) × 「사용횟수별 기준수량 비율(%)」 — 재료별
100·57.0·46.1·40.1·37.1·34.7 · 노무비 100·60.0·47.1·40.0·34.2·32.0 (1~6회).
종전엔 비율 셈이 없어 풀면 1회 값으로 비싸게 서므로 일부러 막아 뒀음(BLOCKED_BY_DESIGN).
⇒ 사람 판정표로 1~6회 갈래를 세우고 재료 줄엔 재료 비율 · 인력 줄엔 노무비 비율.
「사용고재 평가기준 23%」 는 원문이 셈을 안 줘([주]① 2회 이상 비율에 기포함) 값으로 안 씀.
"""
from __future__ import annotations
from B09_Estimation.B09_Estimation_KnownGaps import known_gap_note
from B09_Estimation.B09_Estimation_UnitPrice import cached_build, detail_of
def _labor(code: str) -> dict[str, float]:
rows = detail_of(cached_build(), code)["rows"]
return {r["ref_code"]: float(r["quantity"]) for r in rows if r.get("kind") == "labor"}
def test_사용횟수_여섯_갈래가_서고_인력은_노무비_비율() -> None:
titles = cached_build().book.titles
variants = sorted(c for c in titles if c.startswith("B-FP-12-04#"))
assert variants == [f"B-FP-12-04#{n}회" for n in range(1, 7)], variants
assert _labor("B-FP-12-04#1회") == {"1007": 0.22, "1002": 0.12}
assert _labor("B-FP-12-04#4회") == {"1007": 0.088, "1002": 0.048} # 40.0 %
assert _labor("B-FP-12-04#6회") == {"1007": 0.0704, "1002": 0.0384} # 32.0 %
def test_재료는_재료_비율로_읽고_못_붙은_재료는_사유() -> None:
from B09_Estimation.B09_Estimation_ResourceAxis import (
build_resource_axis,
load_combined_catalog,
load_work_item_master,
)
axis = build_resource_axis(load_work_item_master(), load_combined_catalog())
left = {u.cell for u in axis.unmatched if u.work_item_code == "FP-12-04"}
# 합판·못 은 카탈로그 없음 · 각재·철선·박리제는 규격 미정 — 값을 짓지 않고 못 붙은 줄로
assert {"합판", "못", "각재", "철선", "박리제"} <= {c.replace(" ", "") for c in left}, left
build = cached_build()
assert "FP-12-04" not in build.component_gaps and "FP-12-04" not in build.partial_ratio
note = known_gap_note("FP-12-04")
assert "사용고재" in note and "23" in note, note
def test_거푸집_갈래가_내역에서_금액이_섬() -> None:
from B09_Estimation.B09_Estimation_BillOfQuantities import build_bill
item = {"work_item_code": "FP-12-04", "name": "합판거푸집", "spec": "", "unit": "㎡",
"quantity": "10", "in_bill": True, "variant_axis": "use_count",
"variant_value": "4회"} # fmt: skip
line = next(r for r in build_bill({"work_items": [item], "materials": []}).rows
if r.code == "FP-12-04") # fmt: skip
assert line.price_code == "B-FP-12-04#4회" and line.amount_krw, line.note