後端代碼清理:移除冗餘註解和調試代碼

清理內容:
- 移除所有開發元資訊(Author, Version, DocID, Rationale等)
- 刪除註解掉的代碼片段(力導向演算法等24行)
- 移除調試用的 logger.debug 語句
- 簡化冗餘的內聯註解(emoji、"重要"等標註)
- 刪除 TDD 文件引用

清理檔案:
- backend/main.py - 移除調試日誌和元資訊
- backend/importer.py - 移除詳細類型檢查調試
- backend/export.py - 簡化 docstring
- backend/schemas.py - 移除元資訊
- backend/renderer.py - 移除 TDD 引用
- backend/renderer_timeline.py - 移除註解代碼和冗餘註解
- backend/path_planner.py - 簡化策略註解

保留內容:
- 所有函數的 docstring(功能說明、參數、返回值)
- 必要的業務邏輯註解
- 簡潔的模組功能說明

效果:
- 刪除約 100+ 行冗餘註解
- 代碼更加簡潔專業
- 功能完整性 100% 保留

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
beabigegg
2025-11-06 12:22:29 +08:00
parent dc01655c9e
commit aa987adfb9
7 changed files with 50 additions and 242 deletions

View File

@@ -3,12 +3,6 @@
本模組負責將事件資料轉換為視覺化的時間軸圖表。
使用 Plotly 進行渲染,支援時間刻度自動調整與節點避碰。
Author: AI Agent
Version: 1.0.0
DocID: SDD-REN-001
Related: TDD-UT-REN-001, TDD-UT-REN-002
Rationale: 實現 SDD.md 定義的 POST /render API 功能
"""
from datetime import datetime, timedelta
@@ -36,7 +30,6 @@ class TimeScaleCalculator:
時間刻度計算器
根據事件的時間跨度自動選擇最適合的刻度單位與間隔。
對應 TDD.md - UT-REN-01
"""
@staticmethod
@@ -173,7 +166,6 @@ class CollisionResolver:
節點避碰解析器
處理時間軸上重疊事件的排版,確保事件不會相互覆蓋。
對應 TDD.md - UT-REN-02
"""
def __init__(self, min_spacing: int = 10):