From 4b1f922ce3ad891d4ab7b4097408f382c4e6fe7b Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 8 Aug 2026 16:51:30 +0900 Subject: [PATCH] =?UTF-8?q?fix(B05):=20=EA=B2=BD=EC=9C=A0=EC=A0=90=20?= =?UTF-8?q?=EB=B2=88=ED=98=B8=EA=B0=80=20=EB=B9=84=EB=A9=B4=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=ED=83=90=EC=83=89=EC=9D=B4=20=ED=84=B0=EC=A7=80?= =?UTF-8?q?=EB=8D=98=20=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 화면에서 막 찍은 경유점은 order가 아직 없어 None으로 온다. 정렬 키가 x.get("order", 0)이라 키가 있고 값만 None인 경우를 걸러내지 못해 TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'로 경로 탐색 전체가 실패했다(서버 로그 확인, project_id=fc86f247). None을 0으로 눕힌다 — 파이썬 정렬이 안정적이라 번호가 없는 점들은 받은 순서를 유지한다. 같은 패턴을 쓰던 능선/계곡 탐색기(RidgeValley)도 함께 고쳤다. ruff format·check 통과. Co-Authored-By: Claude Opus 5 (1M context) --- B05_Profile/B05_Profile_Engine_RidgeValley.py | 3 ++- B05_Profile/B05_Profile_Engine_Solver.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/B05_Profile/B05_Profile_Engine_RidgeValley.py b/B05_Profile/B05_Profile_Engine_RidgeValley.py index 216d3848..c44bed63 100644 --- a/B05_Profile/B05_Profile_Engine_RidgeValley.py +++ b/B05_Profile/B05_Profile_Engine_RidgeValley.py @@ -529,7 +529,8 @@ def solve_ridge_valley_route( bp = points_data.get("bp") ep = points_data.get("ep") - cp_list = sorted(points_data.get("cp", []), key=lambda x: x.get("order", 0)) + # 번호가 비어 오는 경유점 처리는 `solve_optimal_route`와 같다 — None 정렬로 터지지 않게. + cp_list = sorted(points_data.get("cp", []), key=lambda item: item.get("order") or 0) ap_list = points_data.get("ap", []) fp_list = points_data.get("fp", []) if not bp or not ep: diff --git a/B05_Profile/B05_Profile_Engine_Solver.py b/B05_Profile/B05_Profile_Engine_Solver.py index 032811de..25f113d8 100644 --- a/B05_Profile/B05_Profile_Engine_Solver.py +++ b/B05_Profile/B05_Profile_Engine_Solver.py @@ -300,7 +300,9 @@ def solve_optimal_route( bp = points_data.get("bp") ep = points_data.get("ep") - cp_list = sorted(points_data.get("cp", []), key=lambda x: x.get("order", 0)) + # 경유점 번호는 비어 올 수 있다(화면에서 막 찍은 점은 아직 번호가 없다). `None`끼리는 + # 비교가 안 돼 정렬이 터지므로 0으로 눕힌다 — 정렬이 안정적이라 받은 순서가 유지된다. + cp_list = sorted(points_data.get("cp", []), key=lambda item: item.get("order") or 0) ap_list = points_data.get("ap", []) fp_list = points_data.get("fp", [])