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:
Yuzviak
2026-05-11 19:13:42 +03:00
parent 1273ec8eaf
commit bf5b0e3ae2
50 changed files with 114 additions and 116 deletions
+2 -2
View File
@@ -3,10 +3,10 @@
import numpy as np
import pytest
pytestmark = [pytest.mark.unit]
from gps_denied.testing.coord import ecef_to_wgs84, euler_to_quaternion
pytestmark = [pytest.mark.unit]
# --- ECEF → WGS84 ---
def test_ecef_origin_is_on_equator_prime_meridian():
+2 -2
View File
@@ -2,8 +2,6 @@
import pytest
pytestmark = [pytest.mark.unit]
from gps_denied.testing.datasets.base import (
DatasetAdapter,
DatasetCapabilities,
@@ -14,6 +12,8 @@ from gps_denied.testing.datasets.base import (
PlatformClass,
)
pytestmark = [pytest.mark.unit]
def test_capabilities_defaults():
cap = DatasetCapabilities(
+2 -2
View File
@@ -5,8 +5,6 @@ from pathlib import Path
import pytest
pytestmark = [pytest.mark.unit]
from gps_denied.testing.download import (
DATASET_REGISTRY,
DatasetSpec,
@@ -14,6 +12,8 @@ from gps_denied.testing.download import (
verify_sha256,
)
pytestmark = [pytest.mark.unit]
def test_registry_has_euroc_machine_hall():
assert "euroc_machine_hall" in DATASET_REGISTRY
+2 -2
View File
@@ -13,12 +13,12 @@ from pathlib import Path
import pytest
pytestmark = [pytest.mark.e2e]
from gps_denied.testing.datasets.euroc import EuRoCAdapter
from gps_denied.testing.harness import E2EHarness
from gps_denied.testing.metrics import absolute_trajectory_error
pytestmark = [pytest.mark.e2e]
# CI-tier keeps the prefix short so a full run stays under a couple of minutes.
EUROC_MH01_MAX_FRAMES = 100
+2 -2
View File
@@ -4,14 +4,14 @@ from pathlib import Path
import pytest
pytestmark = [pytest.mark.unit]
from gps_denied.testing.datasets.base import (
DatasetNotAvailableError,
PlatformClass,
)
from gps_denied.testing.datasets.euroc import EuRoCAdapter
pytestmark = [pytest.mark.unit]
@pytest.fixture
def fake_euroc_root(tmp_path: Path) -> Path:
+2 -2
View File
@@ -17,12 +17,12 @@ from pathlib import Path
import pytest
pytestmark = [pytest.mark.e2e]
from gps_denied.testing.datasets.euroc import EuRoCAdapter
from gps_denied.testing.harness import E2EHarness
from gps_denied.testing.metrics import absolute_trajectory_error
pytestmark = [pytest.mark.e2e]
MAX_FRAMES = 100
VO_SCALE_M = 0.005 # 5 mm/frame — measured GT median on MH_01
+2 -2
View File
@@ -20,12 +20,12 @@ import cv2
import numpy as np
import pytest
pytestmark = [pytest.mark.e2e]
from gps_denied.core.vo import ORBVisualOdometry
from gps_denied.schemas import CameraParameters
from gps_denied.testing.datasets.euroc import EuRoCAdapter
pytestmark = [pytest.mark.e2e]
# Match CI-tier frame cap used in test_euroc.py
EUROC_MH01_MAX_FRAMES = 100
+2 -2
View File
@@ -7,11 +7,11 @@ Correctness of VO on synthetic is out of scope — that's unit-test territory.
import pytest
pytestmark = [pytest.mark.integration]
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
from gps_denied.testing.harness import E2EHarness, HarnessResult
pytestmark = [pytest.mark.integration]
@pytest.mark.asyncio
async def test_harness_processes_every_frame():
+2 -2
View File
@@ -4,11 +4,11 @@ from pathlib import Path
import pytest
pytestmark = [pytest.mark.e2e]
from gps_denied.testing.datasets.mars_lvig import MARSLVIGAdapter
from gps_denied.testing.harness import E2EHarness
pytestmark = [pytest.mark.e2e]
# Stress tier does not gate on RMSE — featureless sequences legitimately cause
# tracking loss. The gate is whether the pipeline RUNS TO COMPLETION without
# crashing, and what fraction of frames produced any estimate at all.
+2 -2
View File
@@ -4,14 +4,14 @@ from pathlib import Path
import pytest
pytestmark = [pytest.mark.unit]
from gps_denied.testing.datasets.base import (
DatasetNotAvailableError,
PlatformClass,
)
from gps_denied.testing.datasets.mars_lvig import MARSLVIGAdapter
pytestmark = [pytest.mark.unit]
@pytest.fixture
def fake_mars_seq(tmp_path: Path) -> Path:
+2 -2
View File
@@ -3,14 +3,14 @@
import numpy as np
import pytest
pytestmark = [pytest.mark.unit]
from gps_denied.testing.metrics import (
absolute_trajectory_error,
relative_pose_error,
trajectory_rmse,
)
pytestmark = [pytest.mark.unit]
def test_rmse_identical_trajectories_is_zero():
est = np.array([[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [2.0, 0.0, 0.0]])
+1 -1
View File
@@ -4,9 +4,9 @@ import numpy as np
import pytest
from gps_denied.testing.datasets.base import PlatformClass
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
pytestmark = [pytest.mark.unit]
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
def test_synthetic_has_raw_imu():
+2 -2
View File
@@ -8,12 +8,12 @@ from pathlib import Path
import pytest
pytestmark = [pytest.mark.e2e]
from gps_denied.testing.datasets.vpair import VPAIRAdapter
from gps_denied.testing.harness import E2EHarness
from gps_denied.testing.metrics import absolute_trajectory_error
pytestmark = [pytest.mark.e2e]
VPAIR_SAMPLE_RMSE_CEILING_M = 20.0 # initial target, calibrate after first runs
+2 -2
View File
@@ -10,14 +10,14 @@ from pathlib import Path
import numpy as np
import pytest
pytestmark = [pytest.mark.unit]
from gps_denied.testing.datasets.base import (
DatasetNotAvailableError,
PlatformClass,
)
from gps_denied.testing.datasets.vpair import VPAIRAdapter
pytestmark = [pytest.mark.unit]
# ECEF for a point at roughly lat=50.737°, lon=7.095°, alt=350m (Bonn/Eifel region).
# Chosen to hit the real VPAIR geographic area so the adapter's conversion
# produces plausible numbers the tests can assert on.