mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-22 19:16:42 +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:
+10
-8
@@ -1,15 +1,17 @@
|
||||
"""Tests for Model Manager (F16)."""
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gps_denied.core.models import ModelManager
|
||||
|
||||
|
||||
def test_load_and_get_model():
|
||||
manager = ModelManager()
|
||||
|
||||
|
||||
# Should auto-load
|
||||
engine = manager.get_inference_engine("SuperPoint")
|
||||
assert engine.model_name == "SuperPoint"
|
||||
|
||||
|
||||
# Check fallback/dummy
|
||||
assert manager.fallback_to_onnx("SuperPoint") is True
|
||||
assert manager.optimize_to_tensorrt("SuperPoint", "path.onnx") == "path.onnx.trt"
|
||||
@@ -18,10 +20,10 @@ def test_load_and_get_model():
|
||||
def test_mock_superpoint():
|
||||
manager = ModelManager()
|
||||
engine = manager.get_inference_engine("SuperPoint")
|
||||
|
||||
|
||||
dummy_img = np.zeros((480, 640, 3), dtype=np.uint8)
|
||||
res = engine.infer(dummy_img)
|
||||
|
||||
|
||||
assert "keypoints" in res
|
||||
assert "descriptors" in res
|
||||
assert "scores" in res
|
||||
@@ -32,17 +34,17 @@ def test_mock_superpoint():
|
||||
def test_mock_lightglue():
|
||||
manager = ModelManager()
|
||||
engine = manager.get_inference_engine("LightGlue")
|
||||
|
||||
|
||||
# Need mock features
|
||||
class DummyF:
|
||||
def __init__(self, keypoints):
|
||||
self.keypoints = keypoints
|
||||
|
||||
|
||||
f1 = DummyF(np.random.rand(120, 2))
|
||||
f2 = DummyF(np.random.rand(150, 2))
|
||||
|
||||
|
||||
res = engine.infer({"features1": f1, "features2": f2})
|
||||
|
||||
|
||||
assert "matches" in res
|
||||
assert len(res["matches"]) == 100 # min(100, 120, 150)
|
||||
assert res["keypoints1"].shape == (100, 2)
|
||||
|
||||
Reference in New Issue
Block a user