feat(B05): 노선 추천 종단 반영 켜기·끄기 + 갈래 설명 한 쪽씩 넘기기
- 64-1: 추천 창 「종단 반영」 체크(기본 켬) — 요청 with_profile 로 서버가 가름 · 끄면 원지반만(63-4 전 점수) · 묶음 캐시에 남은 종단은 걷어 냄 · 값은 편집 창 안에서만(저장 안 함) - 64-2: 설명 칸을 갈래 한 쪽씩 ◀ ▶ + 「n / 8」 · 고른 갈래 쪽부터 · 토공 최소 · 공사비 어림 최소 쪽에 종단 반영 설명 추가 - 시험: test_64_1_profile_toggle.py · ui_checks 64-1 · 64-2 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
@@ -366,6 +366,7 @@ def attach_profile(
|
||||
metrics["profile"] = {"error": str(error)}
|
||||
return
|
||||
estimate = metrics["cut_m3"] + metrics["fill_m3"]
|
||||
metrics["cost_index_base"] = metrics["cost_index"] # 「종단 반영」 끔이 되돌아갈 값
|
||||
metrics["profile"] = profile
|
||||
metrics["earth_estimate_m3"] = round(estimate, 1)
|
||||
metrics["cost_index"] = round(
|
||||
@@ -376,3 +377,19 @@ def attach_profile(
|
||||
def profile_earth(profile: dict[str, Any]) -> float:
|
||||
"""균형 종단 토공 점수 — 절토(자연) + 성토 + 반입 + 사토 ㎥."""
|
||||
return profile["cut_m3"] + profile["fill_m3"] + profile["borrow_m3"] + profile["spoil_m3"]
|
||||
|
||||
|
||||
def plain_metrics(metrics: dict[str, Any]) -> dict[str, Any]:
|
||||
"""균형 종단을 붙이기 전 비교값(복사본) — 「종단 반영」 끔(원지반 가늠 점수).
|
||||
|
||||
묶음 캐시의 비교값은 종단을 붙인 채 남으므로, 끌 때는 붙인 것을 걷어 낸다."""
|
||||
if "profile" not in metrics and "cost_index_base" not in metrics:
|
||||
return metrics
|
||||
plain = {
|
||||
key: value
|
||||
for key, value in metrics.items()
|
||||
if key not in ("profile", "earth_estimate_m3", "cost_index_base")
|
||||
}
|
||||
if "cost_index_base" in metrics:
|
||||
plain["cost_index"] = metrics["cost_index_base"]
|
||||
return plain
|
||||
|
||||
Reference in New Issue
Block a user