revert(tester): 서식만 바뀐 남의 시험 파일 25개 되돌림
ruff 글로브를 `resources/tester/*.py` 로 넓게 잡아 내 작업과 무관한 시험 파일까지 서식이 바뀌었음. 다른 창이 그 파일을 만지면 충돌만 남으므로 되돌림. 내가 실제로 고친 다섯(열쇠 장부·Z01 둘·표 읽기·못 읽은 표)만 남김. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsGw1Dz9HmhuAxGisxmDPF
This commit is contained in:
@@ -21,9 +21,7 @@ sys.path.insert(0, str(ROOT))
|
||||
|
||||
|
||||
def newest_project() -> Path | None:
|
||||
candidates = [
|
||||
p for p in (ROOT / "storage").glob("*/*/*") if (p / "project_manifest.json").is_file()
|
||||
]
|
||||
candidates = [p for p in (ROOT / "storage").glob("*/*/*") if (p / "project_manifest.json").is_file()]
|
||||
return max(candidates, key=lambda p: p.stat().st_mtime) if candidates else None
|
||||
|
||||
|
||||
@@ -65,21 +63,13 @@ def main() -> int:
|
||||
marked = [s for s in stations if s.get("structure")]
|
||||
print(f"2) longitudinal.json 측점={len(stations)} 구조물 표식={len(marked)}건")
|
||||
for station in marked:
|
||||
print(
|
||||
f" - {station.get('chainage_m')}m {station.get('structure')} kind={station.get('kind')}"
|
||||
)
|
||||
print(f" - {station.get('chainage_m')}m {station.get('structure')} kind={station.get('kind')}")
|
||||
|
||||
# 3) 횡단 정본 파일
|
||||
cross_dir = project / "B06_Section" / "cross_sections"
|
||||
files = sorted(cross_dir.glob("cross_*.json")) if cross_dir.is_dir() else []
|
||||
with_structure = [
|
||||
(p.name, read_json(p).get("structure"))
|
||||
for p in files
|
||||
if (read_json(p) or {}).get("structure")
|
||||
]
|
||||
print(
|
||||
f"3) cross_*.json 파일={len(files)}개 구조물 표식={len(with_structure)}건 {with_structure}"
|
||||
)
|
||||
with_structure = [(p.name, read_json(p).get("structure")) for p in files if (read_json(p) or {}).get("structure")]
|
||||
print(f"3) cross_*.json 파일={len(files)}개 구조물 표식={len(with_structure)}건 {with_structure}")
|
||||
|
||||
# 4) B06 읽기 경로 — 실제로 세트가 붙는가
|
||||
from B06_Section.B06_Section_Engine_Culvert import load_culvert_sets
|
||||
|
||||
@@ -105,8 +105,7 @@ def main(argv):
|
||||
if not lengths:
|
||||
continue
|
||||
text = " ".join(
|
||||
f"{side}={'≥' if open_ else ''}{length:.2f}m"
|
||||
for side, (length, open_) in lengths.items()
|
||||
f"{side}={'≥' if open_ else ''}{length:.2f}m" for side, (length, open_) in lengths.items()
|
||||
)
|
||||
print(f"ch={chainage:8.1f} {section['design']['section_mode']:10s} {text}")
|
||||
|
||||
|
||||
@@ -59,6 +59,4 @@ for pipe_file in sorted(ROOT.rglob("pipe_points.json")):
|
||||
verdict = f"허용오차 안 (같은 노선) — {shift:.4f}m ≤ {ROUTE_MATCH_TOLERANCE_M}m"
|
||||
else:
|
||||
verdict = f"⚠ 투영 이월 가지 — {shift:.4f}m > {ROUTE_MATCH_TOLERANCE_M}m"
|
||||
print(
|
||||
f"{project_dir.name[:8]} 관 {len(points):3d}건 · 지문 {stored_sig[:18]:18s} · {src} · {verdict}"
|
||||
)
|
||||
print(f"{project_dir.name[:8]} 관 {len(points):3d}건 · 지문 {stored_sig[:18]:18s} · {src} · {verdict}")
|
||||
|
||||
@@ -24,11 +24,7 @@ ROOT = Path(STORAGE_BASE_DIR)
|
||||
def outer_trend(samples, side):
|
||||
"""바깥 5m 구간의 지반 기울기(수직/수평) — 양수면 바깥으로 갈수록 높아진다."""
|
||||
pts = sorted(
|
||||
(
|
||||
(float(s["offset_m"]), float(s["elevation_m"]))
|
||||
for s in samples
|
||||
if s.get("valid") is not False
|
||||
),
|
||||
((float(s["offset_m"]), float(s["elevation_m"])) for s in samples if s.get("valid") is not False),
|
||||
key=lambda p: p[0],
|
||||
)
|
||||
if side == "left":
|
||||
|
||||
@@ -67,9 +67,7 @@ async def main() -> None:
|
||||
pool = db.get_db_pool()
|
||||
rows = []
|
||||
async with pool.acquire() as conn, conn.cursor() as cur:
|
||||
await cur.execute(
|
||||
"SELECT chainage_m, data FROM cross_sections WHERE route_id=%s", (ROUTE_ID,)
|
||||
)
|
||||
await cur.execute("SELECT chainage_m, data FROM cross_sections WHERE route_id=%s", (ROUTE_ID,))
|
||||
for chainage, data in await cur.fetchall():
|
||||
doc = (json.loads(data) if isinstance(data, str) else data) or {}
|
||||
design = doc.get("design") or {}
|
||||
@@ -80,9 +78,7 @@ async def main() -> None:
|
||||
if not ground or len(line) < 2:
|
||||
continue
|
||||
need = need_width(
|
||||
line,
|
||||
ground,
|
||||
float(design.get("fill_slope_ratio") or 1.2),
|
||||
line, ground, float(design.get("fill_slope_ratio") or 1.2),
|
||||
float(design.get("cut_slope_ratio") or 1.0),
|
||||
)
|
||||
rows.append((float(chainage), need))
|
||||
@@ -94,10 +90,8 @@ async def main() -> None:
|
||||
print(f"· 아무리 넓혀도 안 닫히는 측·조합: {len(never)}건")
|
||||
if finite:
|
||||
finite.sort(key=lambda r: -r[2])
|
||||
print(
|
||||
f"· 넓히면 닫히는 조합: {len(finite)}건 — 필요한 추가 폭 최대 {finite[0][2]:.1f}m, "
|
||||
f"중앙값 {sorted(v for _, _, v in finite)[len(finite) // 2]:.1f}m"
|
||||
)
|
||||
print(f"· 넓히면 닫히는 조합: {len(finite)}건 — 필요한 추가 폭 최대 {finite[0][2]:.1f}m, "
|
||||
f"중앙값 {sorted(v for _, _, v in finite)[len(finite)//2]:.1f}m")
|
||||
for row in finite[:6]:
|
||||
print(f" {row[0]:8.1f}m {row[1]:5s} +{row[2]:.1f}m")
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""코리도 사전 생성 실경로 점검 — 실제 DB·실제 프로젝트로 한 번 돌려 본다(수동 실행)."""
|
||||
|
||||
import asyncio
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""이관한 표가 예전 선·문자 그림과 같은 자리를 그리는지 확인 (수동 실행)."""
|
||||
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, ".")
|
||||
|
||||
from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Table import (
|
||||
@@ -32,17 +30,14 @@ missing = [k for k in QUANTITY_VALUE_KEYS if k not in keyed and k not in ("cut",
|
||||
print("missing keys:", missing)
|
||||
|
||||
back = extract_quantity_table("draw1", {"entities": entities})
|
||||
same = all(back.get(k) == qt[k] for k in QUANTITY_VALUE_KEYS if k not in ("cut", "fill"))
|
||||
same = all(
|
||||
back.get(k) == qt[k] for k in QUANTITY_VALUE_KEYS if k not in ("cut", "fill")
|
||||
)
|
||||
print("round-trip values equal:", same)
|
||||
|
||||
box = _info_box_entities(
|
||||
"draw1",
|
||||
1,
|
||||
{"chainage_m": 100.0, "area_m2": 12345.0, "relief_m": 12.0, "flow_length_m": 34.0},
|
||||
"#fff",
|
||||
(0.0, 0.0),
|
||||
20.0,
|
||||
)
|
||||
box = _info_box_entities("draw1", 1, {"chainage_m": 100.0, "area_m2": 12345.0,
|
||||
"relief_m": 12.0, "flow_length_m": 34.0}, "#fff",
|
||||
(0.0, 0.0), 20.0)
|
||||
assert len(box) == 1 and box[0]["type"] == "Table"
|
||||
bs = box[0]["shapeData"]
|
||||
print("basin columns:", bs["columnWidths"], "rows:", len(bs["rowHeights"]))
|
||||
|
||||
@@ -71,9 +71,7 @@ def test_ditch_shapes_differ_between_types():
|
||||
"""엔진이 두 형식을 서로 다른 단면으로 낸다(3D는 이 단면을 잘라 쓴다)."""
|
||||
from B06_Section.B06_Section_Engine_Design import compute_cross_design
|
||||
|
||||
samples = [
|
||||
{"offset_m": o / 2, "elevation_m": 100.0 + o * 0.02, "valid": True} for o in range(-40, 41)
|
||||
]
|
||||
samples = [{"offset_m": o / 2, "elevation_m": 100.0 + o * 0.02, "valid": True} for o in range(-40, 41)]
|
||||
common = dict(
|
||||
samples=samples,
|
||||
design_elevation_m=100.0,
|
||||
|
||||
@@ -69,10 +69,7 @@ def test_widening_applies_to_outer_side_only() -> None:
|
||||
assert left["widening_left_m"] == 1.5 and left["widening_right_m"] == 0.0
|
||||
# 확폭은 붙은 쪽 차도 끝만 밖으로 민다.
|
||||
assert right["carriageway_edges"]["left"] == base["carriageway_edges"]["left"]
|
||||
assert (
|
||||
right["carriageway_edges"]["right"]["offset_m"]
|
||||
< base["carriageway_edges"]["right"]["offset_m"]
|
||||
)
|
||||
assert right["carriageway_edges"]["right"]["offset_m"] < base["carriageway_edges"]["right"]["offset_m"]
|
||||
assert right["carriageway_width_m"] == base["carriageway_width_m"] + 1.5
|
||||
|
||||
|
||||
@@ -97,7 +94,9 @@ def test_plan_radius_and_outer_side_from_polyline() -> None:
|
||||
angles = np.linspace(0.0, np.pi / 2, 400)
|
||||
radius = 50.0
|
||||
left_turn = np.column_stack([radius * np.cos(angles), radius * np.sin(angles)])
|
||||
chainage = np.r_[0.0, np.cumsum(np.hypot(np.diff(left_turn[:, 0]), np.diff(left_turn[:, 1])))]
|
||||
chainage = np.r_[
|
||||
0.0, np.cumsum(np.hypot(np.diff(left_turn[:, 0]), np.diff(left_turn[:, 1])))
|
||||
]
|
||||
radii, sides = _plan_radii(left_turn, chainage, np.array([40.0]), float(chainage[-1]))
|
||||
assert abs(radii[0] - radius) < 0.1
|
||||
assert sides[0] == "right"
|
||||
|
||||
@@ -34,13 +34,7 @@ _PANEL = _B06 / "B06_Section_UI_Standard_Panel.ts"
|
||||
|
||||
|
||||
def _sources() -> dict[str, str]:
|
||||
files = [
|
||||
_CONFIG,
|
||||
_CHROME,
|
||||
_PANEL,
|
||||
_B06 / "B06_Section_Schema.py",
|
||||
_B06 / "B06_Section_Router.py",
|
||||
]
|
||||
files = [_CONFIG, _CHROME, _PANEL, _B06 / "B06_Section_Schema.py", _B06 / "B06_Section_Router.py"]
|
||||
return {path.name: path.read_text(encoding="utf-8") for path in files}
|
||||
|
||||
|
||||
|
||||
@@ -101,9 +101,7 @@ def test_소유_측점에만_싣는다():
|
||||
layouts = _LAYOUTS.read_text(encoding="utf-8")
|
||||
assert "pipeOwnerChainage" in layouts, "소유 측점을 안 가리고 있다"
|
||||
assert "section.culvert?.chainage_m" in layouts, "관이 놓인 자리를 안 읽고 있다"
|
||||
py = (PROJECT_ROOT / "B06_Section" / "B06_Section_Engine_Culvert.py").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
py = (PROJECT_ROOT / "B06_Section" / "B06_Section_Engine_Culvert.py").read_text(encoding="utf-8")
|
||||
ts = (PROJECT_ROOT / "common_util" / "common_util_culvert_sets.ts").read_text(encoding="utf-8")
|
||||
assert '"chainage_m": pipe_chainage' in py
|
||||
assert "chainage_m: pipeChainage" in ts
|
||||
|
||||
@@ -120,9 +120,7 @@ def test_무대는_막힌_것이_아니다() -> None:
|
||||
|
||||
여기에 막힘 표시를 달면 「만들어야 할 것」 목록에 올라 없는 일이 생긴다.
|
||||
"""
|
||||
rows = 인계(
|
||||
haul_table={"rows": [{"equipment": "free_haul", "ground": "토사", "volume_m3": 10.0}]}
|
||||
)
|
||||
rows = 인계(haul_table={"rows": [{"equipment": "free_haul", "ground": "토사", "volume_m3": 10.0}]})
|
||||
row = next(r for r in rows if r["haul_equipment"] == "free_haul")
|
||||
assert row["in_bill"] is False
|
||||
assert row["blocked_kind"] is None
|
||||
|
||||
@@ -176,24 +176,9 @@ def test_무대는_내역줄이_아님() -> None:
|
||||
source = SummaryInput(
|
||||
earthwork_totals=토적표합계(),
|
||||
haul_rows=[
|
||||
{
|
||||
"equipment": "free_haul",
|
||||
"ground": "토사",
|
||||
"volume_m3": 871,
|
||||
"average_distance_m": 11.94,
|
||||
},
|
||||
{
|
||||
"equipment": "dozer",
|
||||
"ground": "토사",
|
||||
"volume_m3": 1170,
|
||||
"average_distance_m": 43.66,
|
||||
},
|
||||
{
|
||||
"equipment": "dump_truck",
|
||||
"ground": "암",
|
||||
"volume_m3": 1714,
|
||||
"average_distance_m": 318.6,
|
||||
},
|
||||
{"equipment": "free_haul", "ground": "토사", "volume_m3": 871, "average_distance_m": 11.94},
|
||||
{"equipment": "dozer", "ground": "토사", "volume_m3": 1170, "average_distance_m": 43.66},
|
||||
{"equipment": "dump_truck", "ground": "암", "volume_m3": 1714, "average_distance_m": 318.6},
|
||||
],
|
||||
)
|
||||
rows = build_rows(source)
|
||||
@@ -223,14 +208,7 @@ def test_평균운반거리가_비고에_남음() -> None:
|
||||
rows = build_rows(
|
||||
SummaryInput(
|
||||
earthwork_totals=토적표합계(),
|
||||
haul_rows=[
|
||||
{
|
||||
"equipment": "dozer",
|
||||
"ground": "토사",
|
||||
"volume_m3": 1170,
|
||||
"average_distance_m": 43.66,
|
||||
}
|
||||
],
|
||||
haul_rows=[{"equipment": "dozer", "ground": "토사", "volume_m3": 1170, "average_distance_m": 43.66}],
|
||||
)
|
||||
)
|
||||
dozer = next(r for r in rows if r.group == "도자운반")
|
||||
@@ -282,11 +260,7 @@ def test_깨진_파일이어도_화면은_서야_함(tmp_path: Path) -> None:
|
||||
|
||||
def test_한_구획만_갈아끼움(tmp_path: Path) -> None:
|
||||
"""두 페이지가 같은 파일을 쓴다 — 통째로 덮으면 상대 값이 사라진다."""
|
||||
save_section(
|
||||
tmp_path,
|
||||
"estimation",
|
||||
{"rate_dataset": {"dataset_id": "rates", "effective_date": "2026-04-13"}},
|
||||
)
|
||||
save_section(tmp_path, "estimation", {"rate_dataset": {"dataset_id": "rates", "effective_date": "2026-04-13"}})
|
||||
save_section(tmp_path, "quantity", {"rock_class_set": "uljin2"})
|
||||
stored = json.loads((tmp_path / "project_settings.json").read_text(encoding="utf-8"))
|
||||
# 남의 구획이 살아 있다 — B08 이 저장해도 B09 값이 안 지워진다.
|
||||
|
||||
@@ -103,9 +103,7 @@ def test_되돌릴_수_있어야_하는_숫자_칸은_계약에_등록될것() -
|
||||
}
|
||||
assert 숫자칸, "홑 숫자 칸을 하나도 못 골랐다 — 판정이 틀렸다"
|
||||
빠진것 = 숫자칸 - set(NULLABLE_SETTING_KEYS)
|
||||
assert not 빠진것, (
|
||||
f"숫자 칸이 NULLABLE_SETTING_KEYS 에 없다 — 되돌릴 길이 없다: {sorted(빠진것)}"
|
||||
)
|
||||
assert not 빠진것, f"숫자 칸이 NULLABLE_SETTING_KEYS 에 없다 — 되돌릴 길이 없다: {sorted(빠진것)}"
|
||||
|
||||
|
||||
def test_되돌리기_칸은_갈아끼우기_대상이기도_할것() -> None:
|
||||
|
||||
@@ -19,9 +19,9 @@ sys.path.insert(0, str(ROOT))
|
||||
from B08_Quantity.B08_Quantity_Engine_Pipe import build_rows # noqa: E402
|
||||
|
||||
MAPPING = json.loads(
|
||||
(ROOT / "resources" / "data_work_item_mapping" / "work_item_mapping_2026-01-01.json").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
(
|
||||
ROOT / "resources" / "data_work_item_mapping" / "work_item_mapping_2026-01-01.json"
|
||||
).read_text(encoding="utf-8")
|
||||
)["pipe"]
|
||||
|
||||
|
||||
@@ -70,9 +70,7 @@ def test_연장이_오면_값이_선다() -> None:
|
||||
def test_관종으로_공종이_갈린다() -> None:
|
||||
보기 = {"파형강관": "FP-12-11-03", "흄관": "FP-12-11-02", "VR관": "FP-12-11-01"}
|
||||
for kind, code in 보기.items():
|
||||
out = build_rows(
|
||||
[관(85.0, pipe_kind=kind, pipe_diameter_mm=800)], [길이(85.0, 9.0)], MAPPING
|
||||
)
|
||||
out = build_rows([관(85.0, pipe_kind=kind, pipe_diameter_mm=800)], [길이(85.0, 9.0)], MAPPING)
|
||||
assert out["rows"][0]["work_item_code"] == code, kind
|
||||
|
||||
|
||||
|
||||
@@ -216,12 +216,7 @@ def test_법면보호공은_면고르기와_같은_값() -> None:
|
||||
def test_반영률_기본은_100퍼센트() -> None:
|
||||
"""실무 관측 80/50/80 은 참고일 뿐 기본값이 아니다 — 법대로 방침(8-10 ★)."""
|
||||
ratios = SlopeRatios()
|
||||
assert (
|
||||
ratios.bench_cut,
|
||||
ratios.face_dressing,
|
||||
ratios.slope_protection,
|
||||
ratios.tree_removal,
|
||||
) == (
|
||||
assert (ratios.bench_cut, ratios.face_dressing, ratios.slope_protection, ratios.tree_removal) == (
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
|
||||
@@ -591,11 +591,7 @@ def test_부속은_그_칸이_있을_때만_줄이_선다() -> None:
|
||||
def test_부속이_없는_종류에는_아무것도_안_붙는다() -> None:
|
||||
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import attachments_of
|
||||
|
||||
옹벽 = {
|
||||
"structure_id": "s2",
|
||||
"type_id": "retaining_wall",
|
||||
"options": {"inlet_basin_form": "ㄷ형"},
|
||||
}
|
||||
옹벽 = {"structure_id": "s2", "type_id": "retaining_wall", "options": {"inlet_basin_form": "ㄷ형"}}
|
||||
assert attachments_of(옹벽) == []
|
||||
|
||||
|
||||
@@ -635,10 +631,7 @@ def test_서식_규칙이_정상_표를_지우지_말것() -> None:
|
||||
"""⚠ 「구분」·「단가」는 정상 표에도 흔하다 — 하나만 보면 정상 표가 사라진다."""
|
||||
from B08_Quantity.B08_Quantity_Build_WorkItemMaster import detect_form
|
||||
|
||||
소요량표 = {
|
||||
"headers": ["명칭", "규격", "단위", "수량"],
|
||||
"rows": [["보통인부", "", "인", "1.0"]],
|
||||
}
|
||||
소요량표 = {"headers": ["명칭", "규격", "단위", "수량"], "rows": [["보통인부", "", "인", "1.0"]]}
|
||||
assert detect_form(소요량표, "13")[0] == "requirement"
|
||||
구분표 = {
|
||||
"headers": [],
|
||||
|
||||
@@ -23,7 +23,7 @@ from common_util.common_util_crs import ( # noqa: E402
|
||||
)
|
||||
|
||||
UPLOADS = Path(r"C:/Users/umsan/.claude/uploads/ab448e1d-3fa5-4f88-8e02-b26428c8dfc7")
|
||||
LAS_PRJ = UPLOADS / "a450e281-__.prj" # Korean 1985 Modified East Belt → 5176
|
||||
LAS_PRJ = UPLOADS / "a450e281-__.prj" # Korean 1985 Modified East Belt → 5176
|
||||
ROUTE_PRJ = UPLOADS / "105c7734-______.__.2.2.prj" # UTM-K, AUTHORITY 없음 → 5179
|
||||
EXISTING_COMPD_PRJ = (
|
||||
ROOT / "storage/1/3/2f940d8a-2065-4cf6-8bf8-dc3f0af84e57/B03_FileInput/input/prj/result.prj"
|
||||
@@ -131,22 +131,7 @@ def test_analyze_existing_compound_prj_still_5187():
|
||||
|
||||
|
||||
# ── 광역 스윕: 한국 전체 + 해외, WKT 3형식, 익명화 악조건 ────────────────────
|
||||
KOREAN_CODES = (
|
||||
5173,
|
||||
5174,
|
||||
5175,
|
||||
5176,
|
||||
5177,
|
||||
5178,
|
||||
5179,
|
||||
5185,
|
||||
5186,
|
||||
5187,
|
||||
5188,
|
||||
32651,
|
||||
32652,
|
||||
4326,
|
||||
)
|
||||
KOREAN_CODES = (5173, 5174, 5175, 5176, 5177, 5178, 5179, 5185, 5186, 5187, 5188, 32651, 32652, 4326)
|
||||
FOREIGN_CODES = (3857, 32610, 25832, 2154, 27700, 26910, 2193, 6669, 6677, 3095, 28355, 31370)
|
||||
WKT_FORMATS = ("WKT1_GDAL", "WKT2_2019", "WKT1_ESRI")
|
||||
|
||||
|
||||
@@ -62,7 +62,9 @@ def test_도면은_잠금_도각_레이어로_나온다():
|
||||
assert {e["layerId"] for e in drawing["entities"]} == {FRAME_LAYER_ID}
|
||||
layers = {layer["id"]: layer for layer in drawing["layers"]}
|
||||
assert layers[FRAME_LAYER_ID]["isLocked"] is True
|
||||
assert any(not layer["isLocked"] for layer in drawing["layers"]), "덧그릴 비잠금 도면층이 없다"
|
||||
assert any(not layer["isLocked"] for layer in drawing["layers"]), (
|
||||
"덧그릴 비잠금 도면층이 없다"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -19,7 +19,9 @@ sys.path.insert(0, str(ROOT))
|
||||
from common_util.common_util_crs import crs_input_from_prj, identify_epsg # noqa: E402
|
||||
|
||||
COMPOUND_PRJ = next(ROOT.glob("storage/*/*/*/B03_FileInput/input/prj/result.prj"), None)
|
||||
ESRI_PRJ = next(ROOT.glob("resources/knowledge/original/실무문서/**/*중심선(EPSG5176).prj"), None)
|
||||
ESRI_PRJ = next(
|
||||
ROOT.glob("resources/knowledge/original/실무문서/**/*중심선(EPSG5176).prj"), None
|
||||
)
|
||||
|
||||
|
||||
def _read(path: Path) -> str:
|
||||
|
||||
@@ -26,12 +26,8 @@ def _project_root_and_surface():
|
||||
|
||||
async def run():
|
||||
conn = await aiomysql.connect(
|
||||
host=DB_HOST,
|
||||
port=DB_PORT,
|
||||
user=DB_USER,
|
||||
password=DB_PASSWORD,
|
||||
db=DB_NAME,
|
||||
charset="utf8mb4",
|
||||
host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PASSWORD,
|
||||
db=DB_NAME, charset="utf8mb4",
|
||||
)
|
||||
try:
|
||||
async with conn.cursor(aiomysql.DictCursor) as cursor:
|
||||
@@ -39,9 +35,7 @@ def _project_root_and_surface():
|
||||
"SELECT storage_path FROM projects WHERE id = %s", (PROJECT_ID,)
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
from common_util.common_util_surface_confirmation import (
|
||||
get_surface_confirmation_params,
|
||||
)
|
||||
from common_util.common_util_surface_confirmation import get_surface_confirmation_params
|
||||
|
||||
params = await get_surface_confirmation_params(conn, PROJECT_ID)
|
||||
return row, params
|
||||
@@ -120,9 +114,7 @@ def test_edge_trim_3m_ends_are_not_spiky():
|
||||
assert len(trimmed_3) >= 2
|
||||
head, tail, total_3 = _head_tail_within(trimmed_3, 20.0)
|
||||
_, _, total_30 = _head_tail_within(trimmed_30, 20.0)
|
||||
print(
|
||||
f"\n연장: 30m 트림 {total_30:.1f}m / 3m 트림 {total_3:.1f}m (차이 {total_3 - total_30:.1f}m)"
|
||||
)
|
||||
print(f"\n연장: 30m 트림 {total_30:.1f}m / 3m 트림 {total_3:.1f}m (차이 {total_3 - total_30:.1f}m)")
|
||||
|
||||
inner = _slopes(sampler, trimmed_3[len(trimmed_3) // 4 : 3 * len(trimmed_3) // 4])
|
||||
ends = _slopes(sampler, head) + _slopes(sampler, tail)
|
||||
|
||||
@@ -21,12 +21,8 @@ def _project_root() -> Path:
|
||||
|
||||
async def run():
|
||||
conn = await aiomysql.connect(
|
||||
host=DB_HOST,
|
||||
port=DB_PORT,
|
||||
user=DB_USER,
|
||||
password=DB_PASSWORD,
|
||||
db=DB_NAME,
|
||||
charset="utf8mb4",
|
||||
host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PASSWORD,
|
||||
db=DB_NAME, charset="utf8mb4",
|
||||
)
|
||||
try:
|
||||
async with conn.cursor(aiomysql.DictCursor) as cursor:
|
||||
@@ -54,9 +50,7 @@ def test_las_preview_points():
|
||||
meta = analyze_las_metadata(files[0])
|
||||
elapsed = time.perf_counter() - started
|
||||
points = meta.get("preview_points") or []
|
||||
print(
|
||||
f"\n{files[0].name}: 점 {meta['point_count']:,}개, 미리보기 점 {len(points)}개, {elapsed:.1f}s"
|
||||
)
|
||||
print(f"\n{files[0].name}: 점 {meta['point_count']:,}개, 미리보기 점 {len(points)}개, {elapsed:.1f}s")
|
||||
assert 0 < len(points) <= 5000
|
||||
bounds = meta["bounds"]
|
||||
for x, y in points[:200]:
|
||||
@@ -75,9 +69,7 @@ def test_geotiff_thumbnail():
|
||||
meta = analyze_tif_metadata(files[0])
|
||||
elapsed = time.perf_counter() - started
|
||||
thumb = meta.get("preview_thumbnail")
|
||||
print(
|
||||
f"{files[0].name}: 썸네일 {'있음 %d바이트' % len(thumb) if thumb else '없음(오버뷰 없음)'}, {elapsed:.1f}s"
|
||||
)
|
||||
print(f"{files[0].name}: 썸네일 {'있음 %d바이트' % len(thumb) if thumb else '없음(오버뷰 없음)'}, {elapsed:.1f}s")
|
||||
if thumb:
|
||||
assert thumb.startswith("data:image/png;base64,")
|
||||
assert elapsed < 5.0
|
||||
|
||||
@@ -46,9 +46,7 @@ def test_collect_cost_is_small():
|
||||
meta = analyze_las_metadata(path)
|
||||
current = time.perf_counter() - started
|
||||
|
||||
print(
|
||||
f"\n분류 통계만 {baseline:.2f}s / 점 수집 포함 {current:.2f}s "
|
||||
f"(차이 {current - baseline:+.2f}s, 점 {len(meta['preview_points'])}개)"
|
||||
)
|
||||
print(f"\n분류 통계만 {baseline:.2f}s / 점 수집 포함 {current:.2f}s "
|
||||
f"(차이 {current - baseline:+.2f}s, 점 {len(meta['preview_points'])}개)")
|
||||
# 파일을 다시 읽지 않으므로 한 번 훑는 시간과 크게 다르지 않아야 한다.
|
||||
assert current <= baseline * 1.5 + 1.0
|
||||
|
||||
@@ -14,18 +14,10 @@ from pyproj import CRS
|
||||
|
||||
# 한국에서 실제로 들어오는 좌표계만 후보로 둔다.
|
||||
CANDIDATES = (
|
||||
5185,
|
||||
5186,
|
||||
5187,
|
||||
5188, # Korea 2000 (GRS80) 서·중부·동부·동해
|
||||
5179,
|
||||
5178, # UTM-K (GRS80 / Bessel)
|
||||
5173,
|
||||
5174,
|
||||
5176,
|
||||
5177, # Korean 1985 (Bessel) 구 좌표계
|
||||
32652,
|
||||
4326,
|
||||
5185, 5186, 5187, 5188, # Korea 2000 (GRS80) 서·중부·동부·동해
|
||||
5179, 5178, # UTM-K (GRS80 / Bessel)
|
||||
5173, 5174, 5176, 5177, # Korean 1985 (Bessel) 구 좌표계
|
||||
32652, 4326,
|
||||
)
|
||||
_AUTHORITY = re.compile(r'AUTHORITY\["EPSG","(\d+)"\]')
|
||||
|
||||
@@ -92,7 +84,7 @@ def test_uploaded_prj_files() -> None:
|
||||
route = open(upload + "/105c7734-______.__.2.2.prj", encoding="utf-8").read()
|
||||
except FileNotFoundError as e:
|
||||
pytest.skip(f"laptop 업로드 픽스처 없음 (환경 의존): {e.filename}")
|
||||
assert epsg_from_prj(las) == 5176, epsg_from_prj(las) # AUTHORITY 태그로 판별
|
||||
assert epsg_from_prj(las) == 5176, epsg_from_prj(las) # AUTHORITY 태그로 판별
|
||||
assert epsg_from_prj(route) == 5179, epsg_from_prj(route) # 파라미터 지문으로 판별
|
||||
|
||||
|
||||
|
||||
@@ -21,12 +21,8 @@ def _project_root() -> Path:
|
||||
|
||||
async def run():
|
||||
conn = await aiomysql.connect(
|
||||
host=DB_HOST,
|
||||
port=DB_PORT,
|
||||
user=DB_USER,
|
||||
password=DB_PASSWORD,
|
||||
db=DB_NAME,
|
||||
charset="utf8mb4",
|
||||
host=DB_HOST, port=DB_PORT, user=DB_USER, password=DB_PASSWORD,
|
||||
db=DB_NAME, charset="utf8mb4",
|
||||
)
|
||||
try:
|
||||
async with conn.cursor(aiomysql.DictCursor) as cursor:
|
||||
|
||||
Reference in New Issue
Block a user