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:
Yuzviak
2026-04-02 17:09:47 +03:00
parent 094895b21b
commit dd9835c0cd
53 changed files with 395 additions and 374 deletions
+14 -12
View File
@@ -1,12 +1,11 @@
"""Tests for Image Input Pipeline (F05)."""
import asyncio
import cv2
import numpy as np
import pytest
from gps_denied.core.pipeline import ImageInputPipeline, QueueFullError, ValidationError
from gps_denied.core.pipeline import ImageInputPipeline, QueueFullError
from gps_denied.schemas.image import ImageBatch
@@ -30,7 +29,10 @@ def test_batch_validation(pipeline):
assert val1.valid, f"Single-image batch should be valid; errors: {val1.errors}"
# 2-image batch — also valid under new rule
b2 = ImageBatch(images=[b"1", b"2"], filenames=["AD000001.jpg", "AD000002.jpg"], start_sequence=1, end_sequence=2, batch_number=1)
b2 = ImageBatch(
images=[b"1", b"2"], filenames=["AD000001.jpg", "AD000002.jpg"],
start_sequence=1, end_sequence=2, batch_number=1,
)
val2 = pipeline.validate_batch(b2)
assert val2.valid
@@ -45,35 +47,35 @@ def test_batch_validation(pipeline):
@pytest.mark.asyncio
async def test_queue_and_process(pipeline):
flight_id = "test_f1"
# Create valid fake images
fake_img_np = np.zeros((10, 10, 3), dtype=np.uint8)
_, encoded = cv2.imencode(".jpg", fake_img_np)
fake_bytes = encoded.tobytes()
fake_imgs = [fake_bytes] * 10
fake_names = [f"AD{i:06d}.jpg" for i in range(1, 11)]
b = ImageBatch(images=fake_imgs, filenames=fake_names, start_sequence=1, end_sequence=10, batch_number=1)
pipeline.queue_batch(flight_id, b)
# Process
processed = await pipeline.process_next_batch(flight_id)
assert processed is not None
assert len(processed.images) == 10
assert processed.images[0].sequence == 1
assert processed.images[-1].sequence == 10
# Status
st = pipeline.get_processing_status(flight_id)
assert st.total_images == 10
assert st.processed_images == 10
# Sequential get
next_img = pipeline.get_next_image(flight_id)
assert next_img is not None
assert next_img.sequence == 1
# Second get
next_img2 = pipeline.get_next_image(flight_id)
assert next_img2 is not None
@@ -109,9 +111,9 @@ def test_queue_full(pipeline):
fake_imgs = [b"fake"] * 10
fake_names = [f"AD{i:06d}.jpg" for i in range(1, 11)]
b = ImageBatch(images=fake_imgs, filenames=fake_names, start_sequence=1, end_sequence=10, batch_number=1)
pipeline.queue_batch(flight_id, b)
pipeline.queue_batch(flight_id, b)
with pytest.raises(QueueFullError):
pipeline.queue_batch(flight_id, b)