mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-06-21 08:41:12 +00:00
fix(lint): resolve all ruff E402/I001/F821 errors
- Move pytestmark after all imports in 35 test files (E402: not-at-top) - Add TYPE_CHECKING guard for FlightProcessor in composition.py (F821) - Sort import blocks in src/ and tests/ (I001 auto-fix via ruff --fix) - ruff check src/ tests/ now exits 0 with no errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,9 +6,9 @@ re-exported as ``IGlobalPlaceRecognition``.
|
||||
"""
|
||||
|
||||
from gps_denied.components.gpr.faiss_gpr import ( # noqa: F401
|
||||
_FAISS_AVAILABLE,
|
||||
GlobalPlaceRecognition,
|
||||
_faiss,
|
||||
_FAISS_AVAILABLE,
|
||||
)
|
||||
from gps_denied.components.gpr.protocol import ( # noqa: F401
|
||||
IGlobalPlaceRecognition,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
from .mock_mavlink import MockMAVConnection
|
||||
from .protocol import MAVLinkBridgeProtocol
|
||||
from .pymavlink_bridge import (
|
||||
MAVLinkBridge,
|
||||
_PYMAVLINK_AVAILABLE,
|
||||
_unix_to_gps_time,
|
||||
MAVLinkBridge,
|
||||
_confidence_to_fix_type,
|
||||
_eskf_to_gps_input,
|
||||
_unix_to_gps_time,
|
||||
)
|
||||
from .mock_mavlink import MockMAVConnection
|
||||
|
||||
__all__ = [
|
||||
"MAVLinkBridgeProtocol",
|
||||
|
||||
@@ -12,19 +12,19 @@ the legacy ``core/vo.py`` monolith into per-backend modules:
|
||||
The legacy ``gps_denied.core.vo`` import path is preserved as a thin
|
||||
re-export shim for one phase; tests still import from there.
|
||||
"""
|
||||
from gps_denied.components.vio.protocol import (
|
||||
ISequentialVisualOdometry,
|
||||
VisualOdometry,
|
||||
)
|
||||
from gps_denied.components.vio.orbslam_backend import (
|
||||
ORBVisualOdometry,
|
||||
SequentialVisualOdometry,
|
||||
)
|
||||
from gps_denied.components.vio.cuvslam_backend import (
|
||||
CuVSLAMMonoDepthVisualOdometry,
|
||||
CuVSLAMVisualOdometry,
|
||||
)
|
||||
from gps_denied.components.vio.factory import create_vo_backend
|
||||
from gps_denied.components.vio.orbslam_backend import (
|
||||
ORBVisualOdometry,
|
||||
SequentialVisualOdometry,
|
||||
)
|
||||
from gps_denied.components.vio.protocol import (
|
||||
ISequentialVisualOdometry,
|
||||
VisualOdometry,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"VisualOdometry",
|
||||
|
||||
@@ -181,7 +181,7 @@ class AppSettings(BaseSettings):
|
||||
def settings_customise_sources(cls, settings_cls, **kwargs):
|
||||
"""Load YAML overlay from config/{env}.yaml when present."""
|
||||
import os
|
||||
import yaml
|
||||
|
||||
|
||||
init_kwargs = kwargs.get("init_settings")
|
||||
env_settings = kwargs.get("env_settings")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Legacy import path for GPR. Phase 1 shim — code lives in components/gpr/."""
|
||||
from gps_denied.components.gpr.protocol import (
|
||||
IGlobalPlaceRecognition, # noqa: F401
|
||||
)
|
||||
from gps_denied.components.gpr.faiss_gpr import (
|
||||
_FAISS_AVAILABLE,
|
||||
GlobalPlaceRecognition,
|
||||
_faiss,
|
||||
_FAISS_AVAILABLE,
|
||||
)
|
||||
from gps_denied.components.gpr.protocol import (
|
||||
IGlobalPlaceRecognition, # noqa: F401
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Legacy import path. Phase 1 shim — code lives in core/factor_graph.py."""
|
||||
from gps_denied.core.factor_graph import ( # noqa: F401
|
||||
IFactorGraphOptimizer,
|
||||
FactorGraphOptimizer,
|
||||
IFactorGraphOptimizer,
|
||||
)
|
||||
|
||||
@@ -4,18 +4,18 @@ CRITICAL: tests/test_mavlink.py and tests/test_gps_input_encoding.py import
|
||||
private helpers from this path. Per PATTERNS.md §6.2, the underscore names
|
||||
MUST be re-exported here verbatim or 12+ tests break.
|
||||
"""
|
||||
from gps_denied.components.mavlink_io.mock_mavlink import ( # noqa: F401
|
||||
MockMAVConnection,
|
||||
)
|
||||
from gps_denied.components.mavlink_io.protocol import ( # noqa: F401
|
||||
MAVLinkBridgeProtocol,
|
||||
)
|
||||
from gps_denied.components.mavlink_io.pymavlink_bridge import ( # noqa: F401
|
||||
MAVLinkBridge,
|
||||
_PYMAVLINK_AVAILABLE,
|
||||
_unix_to_gps_time,
|
||||
MAVLinkBridge,
|
||||
_confidence_to_fix_type,
|
||||
_eskf_to_gps_input,
|
||||
)
|
||||
from gps_denied.components.mavlink_io.mock_mavlink import ( # noqa: F401
|
||||
MockMAVConnection,
|
||||
_unix_to_gps_time,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"""Legacy import path. Phase 1 shim — code lives in components/satellite_matcher/."""
|
||||
from gps_denied.components.satellite_matcher.protocol import ( # noqa: F401
|
||||
MetricRefiner,
|
||||
IMetricRefinement,
|
||||
)
|
||||
from gps_denied.components.satellite_matcher.metric_refinement import ( # noqa: F401
|
||||
MetricRefinement,
|
||||
)
|
||||
from gps_denied.components.satellite_matcher.protocol import ( # noqa: F401
|
||||
IMetricRefinement,
|
||||
MetricRefiner,
|
||||
)
|
||||
|
||||
__all__ = ["MetricRefinement", "IMetricRefinement", "MetricRefiner"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Legacy import path. Phase 1 shim — code lives in pipeline/orchestrator.py."""
|
||||
from gps_denied.pipeline.orchestrator import ( # noqa: F401
|
||||
FlightProcessor,
|
||||
TrackingState,
|
||||
FrameResult,
|
||||
TrackingState,
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ introduces this type.
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gps_denied.schemas import GPSPoint
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"""Pipeline package: orchestrator + IO + composition root."""
|
||||
from .orchestrator import FlightProcessor
|
||||
from .composition import build_pipeline
|
||||
from .image_input import ImageInputPipeline
|
||||
from .orchestrator import FlightProcessor
|
||||
from .result_manager import ResultManager
|
||||
from .sse_streamer import SSEEventStreamer
|
||||
from .composition import build_pipeline
|
||||
|
||||
Pipeline = FlightProcessor
|
||||
|
||||
|
||||
@@ -15,10 +15,13 @@ Env-conditional wiring
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from gps_denied.obs import configure_logging
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gps_denied.pipeline.orchestrator import FlightProcessor
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ import structlog
|
||||
from structlog.contextvars import bind_contextvars, clear_contextvars
|
||||
|
||||
from gps_denied.core.eskf import ESKF
|
||||
from gps_denied.db.repository import FlightRepository
|
||||
from gps_denied.pipeline.image_input import ImageInputPipeline
|
||||
from gps_denied.pipeline.result_manager import ResultManager
|
||||
from gps_denied.pipeline.sse_streamer import SSEEventStreamer
|
||||
from gps_denied.db.repository import FlightRepository
|
||||
from gps_denied.schemas import CameraParameters, GPSPoint
|
||||
from gps_denied.schemas.flight import (
|
||||
BatchMetadata,
|
||||
|
||||
@@ -4,8 +4,8 @@ from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from gps_denied.pipeline.sse_streamer import SSEEventStreamer
|
||||
from gps_denied.db.repository import FlightRepository
|
||||
from gps_denied.pipeline.sse_streamer import SSEEventStreamer
|
||||
from gps_denied.schemas import GPSPoint
|
||||
from gps_denied.schemas.events import FrameProcessedEvent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user