feat(B05): 초기화 범위 확대 — 배수유역 산출물까지 초기값으로 촬영·복원
- 스냅샷 대상이 B04_PreProcess/drainage/edits 에서 drainage 폴더 통째로 넓어짐 (00_watershed_response ~ 04_detailed_basins 포함). 관을 옮겨 다시 나뉜 세부유역이 초기화로 되돌아가지 않던 구멍을 막음 - 용량 실측: 배수유역 8.6MB, 스냅샷 전체 3.9MB → 약 12MB - 옛 스냅샷(edits 만 촬영) 호환 — 그 경우 예전처럼 관 지점 편집분만 복원 - 3D 코리도는 제외 — 스냅샷 시점(체인 직후)에 아직 없는 값이라 별도 판단 필요 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,13 +30,21 @@ DESIGNING_LOCK_NAME = "initial_design.lock"
|
||||
DESIGN_FAILED_NAME = "initial_design.failed"
|
||||
|
||||
# 프로젝트 루트 기준 상대 경로 — 정본 파일이 사는 자리 전부.
|
||||
#
|
||||
# 배수유역은 `edits/`(관 지점 편집분)만 뜨다가 **폴더 통째**로 넓혔다(2026-09-04 사용자
|
||||
# 확정: 「초기값 = 파일 입력 직후 결과 전부」). 관을 옮기면 세부유역(`04_detailed_basins`)이
|
||||
# 다시 나뉘는데 그 산출물이 스냅샷 밖이라 [초기화]가 옛 유역도를 그대로 남겼다.
|
||||
# 용량은 실측 8.6MB(스냅샷 전체 3.9MB → 약 12MB)로 감당할 만하다.
|
||||
_FILE_TREES = (
|
||||
"B05_Profile/route",
|
||||
"B06_Section/longitudinal",
|
||||
"B06_Section/cross_sections",
|
||||
"B04_PreProcess/drainage/edits",
|
||||
"B04_PreProcess/drainage",
|
||||
)
|
||||
|
||||
# 배수유역을 폴더 통째로 넓히기 전(2026-09-04)에 찍힌 스냅샷이 갖고 있는 자리.
|
||||
_LEGACY_DRAINAGE_TREE = "B04_PreProcess__drainage__edits"
|
||||
|
||||
# `routes.id`를 참조하는 표는 스키마상 이 넷이 전부다(001_create_schema.sql:539~556).
|
||||
_CHILD_TABLES = ("route_points", "route_statistics", "longitudinal_sections", "cross_sections")
|
||||
|
||||
@@ -238,11 +246,20 @@ def wipe_edited_masters(project_root: Path) -> list[str]:
|
||||
|
||||
|
||||
def restore_snapshot_files(project_root: Path) -> None:
|
||||
"""스냅샷 파일을 작업본 자리에 되돌린다. 스냅샷에 없던 트리는 비워 둔다."""
|
||||
"""스냅샷 파일을 작업본 자리에 되돌린다. 스냅샷에 없던 트리는 비워 둔다.
|
||||
|
||||
배수유역 범위를 넓히기 전(2026-09-04)에 찍힌 스냅샷은 `edits/`만 갖고 있다 —
|
||||
그런 프로젝트는 예전처럼 그 자리만 되돌린다. 넓힌 트리를 못 찾았다고 그냥 넘어가면
|
||||
관 지점 편집분이 초기화 뒤에도 남는다.
|
||||
"""
|
||||
root = Path(project_root)
|
||||
source = snapshot_dir(root)
|
||||
for tree in _FILE_TREES:
|
||||
_copy_tree(source / tree.replace("/", "__"), root / tree)
|
||||
stored = source / tree.replace("/", "__")
|
||||
if not stored.is_dir() and tree == "B04_PreProcess/drainage":
|
||||
_copy_tree(source / _LEGACY_DRAINAGE_TREE, root / "B04_PreProcess/drainage/edits")
|
||||
continue
|
||||
_copy_tree(stored, root / tree)
|
||||
|
||||
|
||||
async def restore_initial_snapshot(
|
||||
|
||||
Reference in New Issue
Block a user