style: apply ruff-format to entire codebase

First-time run of ruff-format via pre-commit hook normalises quote
style, trailing commas, and whitespace across 188 Python files.
No logic changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-07-05 14:48:11 +01:00
parent 82e64104fe
commit 96172ca593
189 changed files with 19883 additions and 19552 deletions
+18
View File
@@ -6,12 +6,14 @@ from __future__ import annotations
class TestLoadSignals:
def test_returns_list(self):
from utils.signal_db import load_signals
signals = load_signals()
assert isinstance(signals, list)
assert len(signals) > 0
def test_cached_on_second_call(self):
from utils.signal_db import load_signals
first = load_signals()
second = load_signals()
assert first is second # same object — cached
@@ -20,12 +22,14 @@ class TestLoadSignals:
class TestMatchSignals:
def test_fm_broadcast_matched_at_center(self):
from utils.signal_db import match_signals
results = match_signals(frequency_mhz=98.5)
names = [r["name"] for r in results]
assert "FM Broadcast Radio" in names
def test_frequency_at_exact_range_boundary_included(self):
from utils.signal_db import match_signals
# 87.5 MHz is the lower bound of FM broadcast
results = match_signals(frequency_mhz=87.5)
names = [r["name"] for r in results]
@@ -33,6 +37,7 @@ class TestMatchSignals:
def test_frequency_just_outside_range_excluded(self):
from utils.signal_db import match_signals
# 87.499 MHz is just below FM broadcast lower bound
results = match_signals(frequency_mhz=87.499)
names = [r["name"] for r in results]
@@ -40,12 +45,14 @@ class TestMatchSignals:
def test_no_matches_returns_empty_list(self):
from utils.signal_db import match_signals
# 5000 MHz has no signals in our database
results = match_signals(frequency_mhz=5000.0)
assert results == []
def test_results_have_score_field(self):
from utils.signal_db import match_signals
results = match_signals(frequency_mhz=98.5)
assert len(results) > 0
for r in results:
@@ -55,6 +62,7 @@ class TestMatchSignals:
def test_results_have_match_reasons(self):
from utils.signal_db import match_signals
results = match_signals(frequency_mhz=98.5)
assert len(results) > 0
for r in results:
@@ -63,22 +71,26 @@ class TestMatchSignals:
def test_results_sorted_by_score_descending(self):
from utils.signal_db import match_signals
results = match_signals(frequency_mhz=98.5)
scores = [r["score"] for r in results]
assert scores == sorted(scores, reverse=True)
def test_limit_respected(self):
from utils.signal_db import match_signals
results = match_signals(frequency_mhz=98.5, limit=2)
assert len(results) <= 2
def test_limit_clamped_to_minimum_1(self):
from utils.signal_db import match_signals
results = match_signals(frequency_mhz=98.5, limit=0)
assert len(results) >= 1
def test_bandwidth_within_range_scores_higher(self):
from utils.signal_db import match_signals
# FM broadcast bandwidth_range is 150k250k Hz; 200k is within
with_bw = match_signals(frequency_mhz=98.5, bandwidth_hz=200_000)
without_bw = match_signals(frequency_mhz=98.5)
@@ -88,6 +100,7 @@ class TestMatchSignals:
def test_bandwidth_outside_2x_scores_zero_for_bw_criterion(self):
from utils.signal_db import match_signals
# FM broadcast max_bw is 250k Hz; 600k is > 2× that
results = match_signals(frequency_mhz=98.5, bandwidth_hz=600_000)
fm = next((r for r in results if r["name"] == "FM Broadcast Radio"), None)
@@ -97,6 +110,7 @@ class TestMatchSignals:
def test_modulation_exact_match_scores_higher(self):
from utils.signal_db import match_signals
with_mod = match_signals(frequency_mhz=98.5, modulation="WFM")
without_mod = match_signals(frequency_mhz=98.5)
fm_with = next(r for r in with_mod if r["name"] == "FM Broadcast Radio")
@@ -105,6 +119,7 @@ class TestMatchSignals:
def test_modulation_mismatch_no_mod_reason(self):
from utils.signal_db import match_signals
results = match_signals(frequency_mhz=98.5, modulation="LSB")
fm = next((r for r in results if r["name"] == "FM Broadcast Radio"), None)
if fm:
@@ -112,6 +127,7 @@ class TestMatchSignals:
def test_multi_range_signal_matched_by_any_range(self):
from utils.signal_db import match_signals
# POCSAG has ranges in 138-175 MHz and 450-470 MHz
# Use a high limit so the expanded DB doesn't push it out of the window
results_vhf = match_signals(frequency_mhz=155.0, limit=20)
@@ -123,6 +139,7 @@ class TestMatchSignals:
def test_region_mismatch_does_not_exclude_signal(self):
from utils.signal_db import match_signals
# PMR446 is EU/UK only; should still appear with US region but may score lower
# Use a high limit since the expanded DB has more signals at 446 MHz
results = match_signals(frequency_mhz=446.09375, region="US", limit=20)
@@ -131,6 +148,7 @@ class TestMatchSignals:
def test_original_signal_dict_not_mutated(self):
from utils.signal_db import load_signals, match_signals
original = load_signals()
first_id_before = original[0]["id"]
match_signals(frequency_mhz=98.5, modulation="WFM")