- 원문 본문 식(채워 넣는 서식)을 데이터로: Qt = T/γt×L · n = Qt/(0.7×K) · ㎝t = t1+t2+t3+t4+t5 · Q = 60×Qt×f×E/㎝t - 브레인 판정: n 의 Qt 계산값(원문 표기 10 버림) · 발파암 E 0.9(원문 누락) · Es 운반 줄 값 · 거리별 갈래 - 거리는 B08 인계(유토곡선·사토장)에서 — 내역이 조립에 넘기고, 호표 한 장은 코드 #L…m 에서 되읽음 - 거리 없는 줄은 0 원 아니라 「운반거리 미입력」 · 갈래는 범위 별칭 리핑암 → 암절취 - 배정 프로젝트 164.23m: 토사 3,249원/㎥ · 암절취 8,882원/㎥ · 같은 인계 대조로 바뀐 줄은 이 둘뿐(+1,437,981원) - 시험 5건 · 전체 1761 통과 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
105 lines
4.2 KiB
Python
105 lines
4.2 KiB
Python
"""덤프 운반(산림품셈 10-12 「2. 운반」) — 거리별 호표 · 원문 어긋남은 고른 값·버린 값을 사유에.
|
|
|
|
2026-09-14 축 C 1장 (브레인 판정 ①②④⑤):
|
|
① n 의 Qt = 계산값 T/γt×L (원문 표기 10 버림) ② 발파암 E 0.9 ④ Es = 운반 줄 값
|
|
⑤ 운반거리마다 갈래 · 거리 없으면 0 원 아니라 「운반거리 미입력」
|
|
손셈(토사 164.23 m): Qt 10.2632 · n 16.2907 · t1 6.3885 · t2 3.6131 · ㎝t 12.5016 · f 0.77
|
|
→ Q 34.135 → 34.14(사사오입)
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from decimal import Decimal
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from B09_Estimation.B09_Estimation_MachineProductivity_Dump import ( # noqa: E402
|
|
DUMP_MATERIALS,
|
|
DumpHaul,
|
|
dump_child_for,
|
|
dump_distance_from_code,
|
|
dump_haul_distances,
|
|
dump_title_code,
|
|
)
|
|
from B09_Estimation.B09_Estimation_UnitPrice import cached_build # noqa: E402
|
|
|
|
DISTANCE = Decimal("164.23")
|
|
|
|
|
|
def test_토사_운반_식_손셈() -> None:
|
|
haul = DumpHaul(DUMP_MATERIALS["FP-10-12-01"], DISTANCE)
|
|
assert round(haul.truck_load_m3, 4) == Decimal("10.2632")
|
|
assert round(haul.loader_cycles, 4) == Decimal("16.2907")
|
|
assert round(haul.cycle_minutes, 4) == Decimal("12.5016")
|
|
assert (haul.volume_factor, haul.hourly_output) == (Decimal("0.77"), Decimal("34.14"))
|
|
|
|
|
|
def test_암절취는_계산값_Qt_와_운반줄_Es() -> None:
|
|
haul = DumpHaul(DUMP_MATERIALS["FP-10-12-02"], DISTANCE)
|
|
assert round(haul.truck_load_m3, 4) == Decimal("8.4375") # 원문 표기 10 이 아님
|
|
assert haul.hourly_output == Decimal("12.49")
|
|
assert any("원문 표기" in note for note in DUMP_MATERIALS["FP-10-12-02"].notes)
|
|
assert DUMP_MATERIALS["FP-10-12-03"].truck_efficiency == Decimal("0.9")
|
|
assert any("E 원문 누락" in note for note in DUMP_MATERIALS["FP-10-12-03"].notes)
|
|
|
|
|
|
def test_거리마다_호표가_서고_코드에서_거리를_되읽는다() -> None:
|
|
build = cached_build(dump_haul_m=(str(DISTANCE),))
|
|
code = dump_title_code("FP-10-12-01", DISTANCE)
|
|
assert code == "B-FP-10-12-01#L164.23m"
|
|
money = build.book.resolve(code)
|
|
assert money.total > 0
|
|
assert dump_distance_from_code(code) == ("164.23",)
|
|
assert code not in cached_build().book.titles # 거리 없는 조립엔 안 섬
|
|
|
|
|
|
def test_인계_거리와_갈래_잇기() -> None:
|
|
payload = {
|
|
"work_items": [
|
|
{
|
|
"work_item_code": "FP-10-12",
|
|
"haul_equipment": "dump_truck",
|
|
"haul_distance_m": 164.23,
|
|
},
|
|
{"work_item_code": "FP-10-12", "haul_equipment": "dump_truck", "haul_distance_m": None},
|
|
{"work_item_code": "FP-10-11", "haul_equipment": "dozer", "haul_distance_m": 32.09},
|
|
]
|
|
}
|
|
assert dump_haul_distances(payload) == ("164.23",)
|
|
assert dump_child_for("리핑암", "2026-01-01") == "FP-10-12-02" # 범위 별칭 리핑암 → 암절취
|
|
assert dump_child_for("토사", "2026-01-01") == "FP-10-12-01"
|
|
assert dump_child_for("모르는암", "2026-01-01") is None
|
|
|
|
|
|
def test_내역_줄_거리_없으면_운반거리_미입력() -> None:
|
|
from B09_Estimation.B09_Estimation_BillOfQuantities import build_bill
|
|
|
|
def payload(distance):
|
|
return {
|
|
"work_items": [
|
|
{
|
|
"work_item_code": "FP-10-12",
|
|
"name": "dump_truck 운반",
|
|
"spec": "토사",
|
|
"unit": "㎥",
|
|
"quantity": 40.0,
|
|
"haul_equipment": "dump_truck",
|
|
"haul_distance_m": distance,
|
|
"variant_axis": "ground_class",
|
|
"variant_value": "토사",
|
|
"in_bill": True,
|
|
"origin": "haul",
|
|
}
|
|
],
|
|
"materials": [],
|
|
}
|
|
|
|
blank = build_bill(payload(None), build=cached_build())
|
|
assert any("운반거리 미입력" in m["reason"] for m in blank.missing)
|
|
priced = build_bill(payload(164.23), build=cached_build(dump_haul_m=("164.23",)))
|
|
row = next(r for r in priced.rows if r.name == "dump_truck 운반")
|
|
assert row.price_code == "B-FP-10-12-01#L164.23m" and row.amount_krw > 0
|