fix(B06): 재생성이 구조물(비정규) 측점을 지우던 문제

_regeneration_options가 extra_stations를 넘기지 않아, 반폭 재생성 한 번에
구조물 측점 횡단도가 통째로 사라졌다(2026-08-23 사용자 보고). 옵션 스냅샷
(data.options.extra_stations)에서 목록을 읽어 재생성 옵션에 실어 준다.

자체검증: ./venv/Scripts/python.exe -m pytest tmp/tests/test_regeneration_extra_stations.py -q (2 passed)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-23 18:43:32 +09:00
co-authored by Claude Opus 5
parent 5ac61cb4cc
commit bab1f6b2c2
2 changed files with 27 additions and 0 deletions
+18
View File
@@ -367,10 +367,26 @@ def _regeneration_grade_options(stage_params: dict[str, Any] | None) -> GradeDes
)
def _extra_stations(stored_options: dict[str, Any] | None) -> tuple[tuple[float, str], ...]:
"""구조물(비정규) 측점 목록 — 재생성해도 유지돼야 한다.
옵션 스냅샷(data.options.extra_stations)이 비정규 측점의 단일 소스다. 재생성 옵션에
이 목록을 빼먹으면 구조물 측점이 통째로 지워진다 — 반폭 확대만으로 구조물 횡단도가
사라졌다(2026-08-23 사용자 보고).
"""
snapshot = (stored_options or {}).get("extra_stations") or []
return tuple(
(float(entry[0]), str(entry[1]))
for entry in snapshot
if isinstance(entry, (list, tuple)) and len(entry) >= 2
)
def _regeneration_options(
stored_options: dict[str, Any] | None,
stage_params: dict[str, Any] | None,
cross_half_width_m: float,
extra_stations: tuple[tuple[float, str], ...] = (),
) -> SectionGenerationOptions:
"""DB 저장 옵션(단일 소스) → stage 2 params → config 순으로 유지하고 반폭만 교체한다."""
defaults = SectionGenerationOptions()
@@ -386,6 +402,7 @@ def _regeneration_options(
cross_sample_interval_m=pick("cross_sample_interval_m", defaults.cross_sample_interval_m),
long_sample_interval_m=pick("long_sample_interval_m", defaults.long_sample_interval_m),
include_endpoint=defaults.include_endpoint,
extra_stations=extra_stations,
)
@@ -426,6 +443,7 @@ async def regenerate_sections(
stored_options,
stage_params,
request.cross_half_width_m,
_extra_stations(stored_options),
),
# 계획선까지 함께 재계산·저장 — 없으면 계획 횡단도선·유토곡선이 사라진다.
grade_options=_regeneration_grade_options(stage_params),