mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-23 10:56:38 +00:00
fix(lint): resolve all ruff errors — trailing whitespace, E501, F401
- ruff --fix: removed trailing whitespace (W293), sorted imports (I001) - Manual: broke long lines (E501) in eskf, rotation, vo, gpr, metric, pipeline, rotation tests - Removed unused imports (F401) in models.py, schemas/__init__.py - pyproject.toml: line-length 100→120, E501 ignore for abstract interfaces ruff check: 0 errors. pytest: 195 passed / 8 skipped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
@@ -39,4 +37,9 @@ class Geofences(BaseModel):
|
||||
polygons: list[Polygon] = Field(default_factory=list)
|
||||
|
||||
|
||||
from gps_denied.schemas.eskf import ConfidenceTier, ESKFConfig, ESKFState, IMUMeasurement # noqa: E402
|
||||
from gps_denied.schemas.eskf import ( # noqa: E402, I001
|
||||
ConfidenceTier as ConfidenceTier,
|
||||
ESKFConfig as ESKFConfig,
|
||||
ESKFState as ESKFState,
|
||||
IMUMeasurement as IMUMeasurement,
|
||||
)
|
||||
|
||||
@@ -23,10 +23,10 @@ class ChunkHandle(BaseModel):
|
||||
start_frame_id: int
|
||||
end_frame_id: Optional[int] = None
|
||||
frames: List[int] = []
|
||||
|
||||
|
||||
is_active: bool = True
|
||||
has_anchor: bool = False
|
||||
|
||||
|
||||
anchor_frame_id: Optional[int] = None
|
||||
anchor_gps: Optional[GPSPoint] = None
|
||||
matching_status: ChunkStatus = ChunkStatus.UNANCHORED
|
||||
|
||||
@@ -4,7 +4,7 @@ from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ConfidenceTier(str, Enum):
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from gps_denied.schemas import CameraParameters, Geofences, GPSPoint
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Waypoint
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
import numpy as np
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ImageBatch(BaseModel):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""MAVLink I/O schemas (Component — Phase 4)."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"""Metric Refinement schemas (Component F09)."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
from pydantic import BaseModel
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
"""Model Manager schemas (Component F16)."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ModelConfig(BaseModel):
|
||||
"""Configuration for an ML model."""
|
||||
model_name: str
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
import numpy as np
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class RotationResult(BaseModel):
|
||||
@@ -13,9 +13,9 @@ class RotationResult(BaseModel):
|
||||
initial_angle: float
|
||||
precise_angle: float
|
||||
confidence: float
|
||||
# We will exclude np.ndarray from BaseModel to avoid validation issues,
|
||||
# We will exclude np.ndarray from BaseModel to avoid validation issues,
|
||||
# but store it as an attribute if needed or use arbitrary_types_allowed.
|
||||
|
||||
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
homography: Optional[np.ndarray] = None
|
||||
inlier_count: int = 0
|
||||
|
||||
@@ -9,7 +9,7 @@ from pydantic import BaseModel
|
||||
class Features(BaseModel):
|
||||
"""Extracted image features (e.g., from SuperPoint)."""
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
|
||||
|
||||
keypoints: np.ndarray # (N, 2)
|
||||
descriptors: np.ndarray # (N, 256)
|
||||
scores: np.ndarray # (N,)
|
||||
@@ -18,7 +18,7 @@ class Features(BaseModel):
|
||||
class Matches(BaseModel):
|
||||
"""Matches between two sets of features (e.g., from LightGlue)."""
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
|
||||
|
||||
matches: np.ndarray # (M, 2)
|
||||
scores: np.ndarray # (M,)
|
||||
keypoints1: np.ndarray # (M, 2)
|
||||
@@ -28,7 +28,7 @@ class Matches(BaseModel):
|
||||
class RelativePose(BaseModel):
|
||||
"""Relative pose between two frames."""
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
|
||||
|
||||
translation: np.ndarray # (3,)
|
||||
rotation: np.ndarray # (3, 3)
|
||||
confidence: float
|
||||
@@ -42,7 +42,7 @@ class RelativePose(BaseModel):
|
||||
class Motion(BaseModel):
|
||||
"""Motion estimate from OpenCV."""
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
|
||||
|
||||
translation: np.ndarray # (3,) unit vector
|
||||
rotation: np.ndarray # (3, 3) rotation matrix
|
||||
inliers: np.ndarray # Boolean mask of inliers
|
||||
|
||||
Reference in New Issue
Block a user