Files
PLFM_RADAR/pyproject.toml
Jason 0728d931c4 chore(repo): PR-H — G-series close-out (regression infra + lint sweep)
Closeout pass for the G-series 3-ladder chirp + adaptive-escalation work.
Cleanup, watchdog/fallback, lint, full regression — final sign-off.

Cleanup + watchdog/fallback: already wired during earlier audit waves
(track watchdog in chirp_scheduler RP_DEF_TRACK_WATCHDOG_FRAMES, RESERVED
fallback in plfm_chirp_controller_v2, range-decim watchdog in
radar_system_top with gpio_dig7 surfacing, F-3.* MCU error path).
Verified — no residual TODO/FIXME in production RTL or MCU.

Regression infra: tb/cosim/compare_independent.py SKIP-detection bug —
importlib.util.find_spec("scipy.signal") raises ModuleNotFoundError when
the parent scipy package is itself absent (instead of returning None as
the surrounding logic assumed). Wrap in try/except so the regression
runner gets the intended rc=2 SKIP marker rather than a crash that masks
the rest of the script.

Lint sweep: ruff full-repo → 0 errors. Two changes:
  - pyproject.toml broadens 5_Simulations/Antenna/**.py exemption from
    just T20+ERA to the full set of script-ergonomics rules
    (RUF001/002/003 Greek µ/λ/π/θ in physical-units strings, E501 long
    matplotlib/numpy lines, RUF005/015/046, E70x one-line setup, B007
    tuple-unpack loop vars, B905, BLE001 diag try/except, C401, RET504,
    SIM118, PERF40x, ARG001, E402). These are sim/analysis scripts, not
    production code — keep substantive bug rules (F unused, B core
    bugbears) but drop stylistic noise.
  - Auto-fix sweep: 31x F541 (f-string-no-placeholder), 3x F401 (unused
    sys import), 2x F841 (dead leftover ref_pat / phases_quant in
    array_factor_adar1000_aeris10.py).

.gitignore: cover 9_Firmware/9_2_FPGA/tb/cosim/mf_chain_autocorr.csv
(matched_filter cosim writes here now; was already covered for tb/ but
not tb/cosim/).

Regression baseline (radar_venv):
  FPGA  : 42/43 — 1 pre-existing T-6 drift cosim fail surfaced by the
          SKIP fix above. Three sub-checks now red because PR-O moved
          xFFT/MF chain to LogiCORE v9.1 *Scaled* mode (1/2 per stage,
          1/2^11 total for N=2048) but compare_independent.py's invariants
          (FFT-impulse uniform-spectrum, MF peak-at-injected-delay, MF
          peak/median ≥ 5) were written assuming UNSCALED FFT. Not
          introduced by this PR — was hidden by the SKIP-detection crash.
          Defer to PR-M.4: redesign T-6 invariants (or input amplitudes)
          to match scaled-mode arithmetic.
  MCU   : 34/34 binary suites pass.
  GUI   : test_v7 150/150 pass.

uv.lock: scipy resolution catch-up (declared in pyproject dev group all
along; lock just hadn't been refreshed after pyproject edits landed).

Bench-side checks: none — this PR is repo hygiene, no firmware/RTL
behaviour change.
2026-05-05 10:39:57 +05:45

77 lines
3.7 KiB
TOML

[project]
name = "aeris-10-radar"
version = "1.0.0"
description = "AERIS-10 FMCW Radar Platform — host software & FPGA cosim tools"
requires-python = ">=3.12"
# Runtime dependencies intentionally empty — GUI deps are optional and
# listed in requirements_*.txt files for local installs.
dependencies = []
[dependency-groups]
dev = [
"ruff>=0.5",
"pytest>=8",
"numpy>=1.26",
"scipy>=1.13", # PR-M: tb/cosim/compare_independent.py (T-6 drift cosim)
"h5py>=3.10",
]
# ---------------------------------------------------------------------------
# Ruff configuration
# ---------------------------------------------------------------------------
[tool.pytest.ini_options]
markers = [
"slow: full-sweep tests (opt-in via -m slow); audit F-3.2 100-seed fuzz",
]
[tool.ruff]
target-version = "py312"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes (unused imports, undefined names, duplicate keys, assert-tuple)
"B", # flake8-bugbear (mutable defaults, unreachable code, raise-without-from)
"RUF", # ruff-specific (unused noqa, ambiguous chars, implicit Optional)
"SIM", # flake8-simplify (dead branches, collapsible ifs, unnecessary pass)
"PIE", # flake8-pie (no-op expressions, unnecessary spread)
"T20", # flake8-print (stray print() calls — LLMs leave debug prints)
"ARG", # flake8-unused-arguments (LLMs generate params they never use)
"ERA", # eradicate (commented-out code — LLMs leave "alternatives" as comments)
"A", # flake8-builtins (LLMs shadow id, type, list, dict, input, map)
"BLE", # flake8-blind-except (bare except / overly broad except)
"RET", # flake8-return (unreachable code after return, unnecessary else-after-return)
"ISC", # flake8-implicit-str-concat (missing comma in list of strings)
"TCH", # flake8-type-checking (imports only used in type hints — move behind TYPE_CHECKING)
"UP", # pyupgrade (outdated syntax for target Python version)
"C4", # flake8-comprehensions (unnecessary list/dict calls around generators)
"PERF", # perflint (performance anti-patterns: unnecessary list() in for loops, etc.)
]
[tool.ruff.lint.per-file-ignores]
# Tests: allow unused args (fixtures), prints (debugging), commented code (examples)
"test_*.py" = ["ARG", "T20", "ERA"]
# Re-export modules: unused imports are intentional
"v7/hardware.py" = ["F401"]
# FPGA cosim scripts: CLI tools — print() is the intended output channel
"9_Firmware/9_2_FPGA/tb/cosim/**.py" = ["T20"]
# Antenna sim/verification scripts: engineering-analysis ergonomics. print()
# is the intended output channel; module-header docstrings include "How to
# run" shell examples; comments/labels use Greek letters (µ, λ, π, θ, °) for
# physical units; matplotlib/numpy idioms produce long lines and multi-stmt
# constructs. Keep substantive bug rules (F unused-imports/vars, B core
# bugbears) — drop stylistic noise.
"5_Simulations/Antenna/**.py" = [
"T20", "ERA", # print + "How to run" header examples
"RUF001","RUF002","RUF003", # Greek letters (µ, λ, π, θ) in strings/comments
"RUF005","RUF015","RUF046","RUF059", # collection/iteration ergonomics
"E501", # long matplotlib/numpy lines
"E701","E702", # one-line setup statements
"B007","B905","BLE001", # unused loop var, zip strict, broad-except diag
"C401","RET504","SIM118", # generator/in-dict ergonomics
"PERF401","PERF402", # comprehension perf hints
"ARG001","E402", # kwargs API + post-import-guard ordering
]