feat(b06·b08): ㉱ (나) 암 환산계수를 구성비 가중으로 — 토적표·유토곡선·운반표가 한 함수(mixed_conversion_factors)
- B06 암은 한 종류 자리표시라 토적표 보정량·유토곡선이 리핑암 C 하나로 쌓았음 · 구성비·갈래별 시공법이 다 서면 암 두 칸을 Σ몫×C(시공법)로 · 비면 종전 값(인계가 막힘 사유) - 계수를 내는 곳 넷(B06 서버 재계산·곡선 문맥 · B08 토적표·사토 계수)이 같은 함수 · 화면 「무엇을 골랐나」는 갈래별 값 그대로 - 936be972 연암 60 리핑/보통암 40 발파 · 서버 재계산: 토적표 깎기 보정량 6,296.81 = 유토곡선 6,296.8 · 암 보정량 4,167.31 → 4,384.74 · 토취 7,259.84 → 7,053.83 · 사토 55.31 → 58.2 · 운반 검산 0 · 되돌려 재계산 원래 값 그대로 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
"""㉱ (나) 암 환산계수를 구성비 가중으로 — 2026-09-14 브레인 판정(구성비가 정본 · (가) 뒤 차례).
|
||||
|
||||
B06 의 암은 한 종류 자리표시(`ripping_rock`)라 토적표 보정량·유토곡선이 리핑암 C 하나로 쌓았음 —
|
||||
구성비 60/40(리핑·발파)이면 토적표 암 보정량이 217.43㎥ 덜 섬(936be972 실측). ⇒ 계수를 내는 한 곳에서
|
||||
암 두 칸을 Σ몫×C(시공법)로 · 구성비나 시공법이 비면 종전 값(인계가 막힘 사유를 냄 · 지어낸 계수 안 씀).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1].parent
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from common_util.common_util_project_settings import ( # noqa: E402
|
||||
earthwork_conversion_choices,
|
||||
earthwork_conversion_factors,
|
||||
mixed_conversion_factors,
|
||||
)
|
||||
|
||||
MIX = {
|
||||
"rock_class_set": "geochang5",
|
||||
"rock_ratios_pct": {"연암": 60, "보통암": 40},
|
||||
"rock_methods": {"연암": "ripping", "보통암": "blasting"},
|
||||
}
|
||||
|
||||
|
||||
def test_구성비와_시공법이_서면_암_두_칸이_가중_C() -> None:
|
||||
factors = mixed_conversion_factors(MIX)
|
||||
for kind in ("ripping_rock", "blasting_rock"):
|
||||
assert factors[kind]["compacted"] == pytest.approx(0.6 * 1.15 + 0.4 * 1.30)
|
||||
assert factors["soil"] == earthwork_conversion_factors(MIX)["soil"]
|
||||
|
||||
|
||||
def test_고른_계수_위에서_가중() -> None:
|
||||
settings = {**MIX, "conversion_factors_override": {"ripping_rock": {"compacted": 1.0}}}
|
||||
assert mixed_conversion_factors(settings)["ripping_rock"]["compacted"] == pytest.approx(
|
||||
0.6 * 1.0 + 0.4 * 1.30
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"settings",
|
||||
[
|
||||
{"rock_class_set": "geochang5"},
|
||||
{**MIX, "rock_methods": {"연암": "ripping"}},
|
||||
],
|
||||
)
|
||||
def test_구성비나_시공법이_비면_종전_값(settings: dict) -> None:
|
||||
assert mixed_conversion_factors(settings) == earthwork_conversion_factors(settings)
|
||||
|
||||
|
||||
def test_화면_고른_값_표시는_갈래별_그대로() -> None:
|
||||
assert earthwork_conversion_choices(MIX)["ripping_rock"]["compacted"] == pytest.approx(1.15)
|
||||
|
||||
|
||||
def test_토적표_유토곡선_운반표가_같은_함수를_씀() -> None:
|
||||
prebuild = (ROOT / "B06_Section" / "B06_Section_Server_Calc_Prebuild.py").read_text("utf-8")
|
||||
router = (ROOT / "B08_Quantity" / "B08_Quantity_Router_Earthwork.py").read_text("utf-8")
|
||||
assert prebuild.count("mixed_conversion_factors(") == 2
|
||||
assert "earthwork_conversion_factors(" not in prebuild
|
||||
assert router.count("mixed_conversion_factors(settings)") == 2
|
||||
Reference in New Issue
Block a user