104: C/I scaling, validation rules + CI fix #44

Merged
ykp merged 2 commits from feat/104-ci-validation into main 2026-10-06 19:20:17 +02:00
Owner

Step 104 — C/I scaling, power computation, validation rules

Also fixes the CI failure caused by test_import_headless crashing on slim containers where Tkinter's C extension (_tkinter) is missing.

Changes

  • src/testgnss/ci.py — C/I scaling module:
    • estimate_power() — mean squared magnitude
    • compute_interference_gain() — power-referenced scaling factor
    • apply_interference() — composite signal with truncated common length
  • src/testgnss/validation.py — T1–T7 validation rules plus ValidationError exception
  • tests/test_testgnss_ci.py — 15 tests (constant/noise power, C/I accuracy, zero-power rejection, length mismatch)
  • tests/test_testgnss_validation.py — 29 tests (all T-rules, all-pass valid cases, error properties)
  • tests/test_testgnss_smoke.py — Fix test_import_headless: catch ImportError when _tkinter shared library is absent (slim Docker containers)
  • Backlog: 102/103 moved to docs/done/

Verification

pytest tests/test_testgnss_ci.py tests/test_testgnss_validation.py tests/test_testgnss_smoke.py -q
44 passed
ruff check src/testgnss/ tests/
All checks passed

Depends on: 102 (IQ file readers)

## Step 104 — C/I scaling, power computation, validation rules Also fixes the CI failure caused by `test_import_headless` crashing on slim containers where Tkinter's C extension (`_tkinter`) is missing. ### Changes - **`src/testgnss/ci.py`** — C/I scaling module: - `estimate_power()` — mean squared magnitude - `compute_interference_gain()` — power-referenced scaling factor - `apply_interference()` — composite signal with truncated common length - **`src/testgnss/validation.py`** — T1–T7 validation rules plus `ValidationError` exception - **`tests/test_testgnss_ci.py`** — 15 tests (constant/noise power, C/I accuracy, zero-power rejection, length mismatch) - **`tests/test_testgnss_validation.py`** — 29 tests (all T-rules, all-pass valid cases, error properties) - **`tests/test_testgnss_smoke.py`** — Fix `test_import_headless`: catch `ImportError` when `_tkinter` shared library is absent (slim Docker containers) - **Backlog**: 102/103 moved to `docs/done/` ### Verification ``` pytest tests/test_testgnss_ci.py tests/test_testgnss_validation.py tests/test_testgnss_smoke.py -q 44 passed ruff check src/testgnss/ tests/ All checks passed ``` Depends on: 102 (IQ file readers)
104(testgnss): C/I scaling, validation rules + CI fix
Some checks failed
ci / test (3.14) (push) Failing after 59s
ci / test (3.12) (push) Failing after 1m4s
ci / test (3.9) (push) Failing after 1m44s
ci / testgnss (3.12) (push) Failing after 1m46s
ci / testgnss (3.9) (push) Failing after 2m14s
ci / testgnss (3.14) (push) Failing after 2m19s
ci / test (3.9) (pull_request) Has been cancelled
ci / testgnss (3.12) (pull_request) Has been cancelled
ci / testgnss (3.14) (pull_request) Has been cancelled
ci / testgnss (3.9) (pull_request) Has been cancelled
ci / test (3.12) (pull_request) Has been cancelled
ci / test (3.14) (pull_request) Has been cancelled
19cf9ad85b
- src/testgnss/ci.py: estimate_power, compute_interference_gain,
  apply_interference (power-referenced C/I scaling per spec §2.3, §3)
- src/testgnss/validation.py: T1–T7 validation rules (§7), ValidationError
- tests/test_testgnss_ci.py: 15 tests (constant/noise power, C/I accuracy,
  zero-power rejection, length mismatch warning)
- tests/test_testgnss_validation.py: 29 tests (all T-rules + all-pass cases)
- Fix test_import_headless: catch ImportError when tkinter C lib missing
  (slim CI containers lack libtk8.6.so)
- Backlog: move 102/103 to docs/done/, update overview status
ykp force-pushed feat/104-ci-validation from 19cf9ad85b
Some checks failed
ci / test (3.14) (push) Failing after 59s
ci / test (3.12) (push) Failing after 1m4s
ci / test (3.9) (push) Failing after 1m44s
ci / testgnss (3.12) (push) Failing after 1m46s
ci / testgnss (3.9) (push) Failing after 2m14s
ci / testgnss (3.14) (push) Failing after 2m19s
ci / test (3.9) (pull_request) Has been cancelled
ci / testgnss (3.12) (pull_request) Has been cancelled
ci / testgnss (3.14) (pull_request) Has been cancelled
ci / testgnss (3.9) (pull_request) Has been cancelled
ci / test (3.12) (pull_request) Has been cancelled
ci / test (3.14) (pull_request) Has been cancelled
to 2ea2edcf25
Some checks failed
ci / test (3.9) (push) Has been cancelled
ci / testgnss (3.12) (push) Has been cancelled
ci / testgnss (3.14) (push) Has been cancelled
ci / testgnss (3.9) (push) Has been cancelled
ci / test (3.12) (pull_request) Has been cancelled
ci / test (3.14) (pull_request) Has been cancelled
ci / test (3.9) (pull_request) Has been cancelled
ci / testgnss (3.12) (pull_request) Has been cancelled
ci / testgnss (3.14) (pull_request) Has been cancelled
ci / testgnss (3.9) (pull_request) Has been cancelled
ci / test (3.14) (push) Has been cancelled
ci / test (3.12) (push) Has been cancelled
2026-10-06 18:33:26 +02:00
Compare
ykp referenced this pull request from a commit 2026-10-06 18:33:52 +02:00
docs: mark step 104 as PR #44
Some checks failed
ci / test (3.14) (push) Failing after 2m14s
ci / test (3.12) (push) Successful in 2m35s
ci / test (3.9) (push) Successful in 2m8s
ci / testgnss (3.12) (push) Successful in 1m52s
ci / testgnss (3.14) (push) Successful in 2m17s
ci / testgnss (3.9) (push) Successful in 2m12s
ci / test (3.12) (pull_request) Failing after 2m18s
ci / test (3.14) (pull_request) Successful in 2m33s
ci / test (3.9) (pull_request) Successful in 2m18s
ci / testgnss (3.12) (pull_request) Successful in 2m8s
ci / testgnss (3.14) (pull_request) Successful in 2m0s
ci / testgnss (3.9) (pull_request) Successful in 2m3s
3c5eb2815d
ykp merged commit 90b250986d into main 2026-10-06 19:20:17 +02:00
ykp deleted branch feat/104-ci-validation 2026-10-06 19:20:17 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ykp/gengnss!44
No description provided.