fix(472 덧 종단 경고): [저장] · [확정] 재계산이 종단 경고를 저장 입력으로 다시 씀 · 경고 글 TS 한 벌
- 서버 재계산(_recompute) 맨 앞 refresh_alignment — 저장 base_pvi · 편집 · 정책 · 기준으로 경고만 지금 코드 값 · 기하(계획고 · 곡선 · 표본 · 위반)는 저장값 그대로 · 같으면 안 씀 · grade_summary 함께 - 파이썬 경고 글을 TS buildAlignment 꼴로(접두 「chainage 」 뺌 · 기울기 초과 · 불균형 총괄 줄 뺌 — violations · balance 칸이 정본) - 거울 시험 test_472_save_warnings(옛 코드 실패 확인) · 기준값 경고 칸만 다시 뜸(server_save 5→50 · server_route 51→50 · 브레인 승인) · W0 정리 · W1 지움 - 위키 계산 목록 P8 · [저장] 차례 cross 줄 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,8 @@ scipy에 의존하지 않는 순수 기하 계산만 두어 프론트엔드 구
|
||||
|
||||
직선 판정 짝: `is_straight_bend` · `STRAIGHT_HEIGHT_M` ↔ TS `logic/B05_Profile_Profile_Straight.ts`
|
||||
(거울 시험 `test_426_profile_straight.py`).
|
||||
경고 글 짝: `build_alignment` warnings ↔ TS `buildAlignment` warnings — 같은 목록
|
||||
(거울 시험 `test_472_save_warnings.py`).
|
||||
"""
|
||||
|
||||
from dataclasses import dataclass
|
||||
@@ -369,7 +371,7 @@ def build_curves(
|
||||
continue
|
||||
if length / 2.0 - half > 1e-6:
|
||||
warnings.append(
|
||||
f"chainage {chainage:.1f}m: 인접 직선이 짧아 종단곡선 길이를 "
|
||||
f"{chainage:.1f}m: 인접 직선이 짧아 종단곡선 길이를 "
|
||||
f"{half * 2.0:.1f}m(반경 {half * 2.0 / abs(delta):.0f}m)로 줄였습니다."
|
||||
)
|
||||
length = half * 2.0
|
||||
@@ -592,18 +594,9 @@ def build_alignment(
|
||||
for segment in segments
|
||||
if abs(segment["grade_percent"]) > policy.max_grade_pct + 1e-6
|
||||
]
|
||||
if violations:
|
||||
worst = max(abs(item["value"]) for item in violations)
|
||||
warnings.append(
|
||||
f"종단기울기 {worst:.2f}%가 기준 {policy.max_grade_pct:.2f}%를 초과하는 구간이 "
|
||||
f"{len(violations)}개 있습니다."
|
||||
)
|
||||
# 경고 글 = TS `buildAlignment` 와 한 벌(472 덧 · 거울 `test_472_save_warnings`) — 기울기 초과 ·
|
||||
# 불균형은 글로 안 남김(`violations` · `balance` 칸이 정본 · 화면 칩이 그 칸으로 셈)
|
||||
within_tolerance = imbalance <= policy.balance_tolerance_percent + 1e-9
|
||||
if not within_tolerance:
|
||||
warnings.append(
|
||||
f"절·성토 불균형 {imbalance:.1f}%가 허용치 "
|
||||
f"{policy.balance_tolerance_percent:.1f}%를 초과합니다."
|
||||
)
|
||||
|
||||
return {
|
||||
"schema_version": ALIGNMENT_SCHEMA_VERSION,
|
||||
|
||||
Reference in New Issue
Block a user