2.2 KiB
2.2 KiB
Repository Guidelines
Project Structure & Module Organization
main.py: Tkinter GUI for radar data analysis; watches a data folder, parses RAW/SYNC_DET/FOURIER files, and renders B‑scan/Fourier views.datagen.py: Test data generator for RAW, SYNC_DET, and FOURIER; produces time‑stamped files to feed the GUI.testLadArrayGround.m: MATLAB scratch for algorithm experiments.- Tests: none yet. Add under
tests/(e.g.,tests/test_io.py). If processing grows, factor helpers into aprocessing/package (e.g.,processing/signal.py).
Build, Test, and Development Commands
- Create venv:
python3 -m venv .venv && source .venv/bin/activate(Win:.venv\Scripts\activate). - Install deps:
pip install numpy scipy matplotlib. Linux may require Tk:sudo apt-get install -y python3-tk. - Run GUI:
python main.py. - Generate sample data:
python datagen.pyand choose 1/2/3; files go to the configured data folder. - Run tests (when added):
pytest -q.
Coding Style & Naming Conventions
- Follow PEP 8 with 4‑space indents; add type hints for new/edited functions.
- Naming: snake_case (functions/vars), PascalCase (classes), UPPER_SNAKE_CASE (constants).
- Keep GUI logic in
main.py; move pure processing/IO into small, testable modules.
Testing Guidelines
- Framework: pytest (recommended). No suite exists yet.
- Naming:
tests/test_*.py. Use temp dirs for file‑based tests; don’t write to system paths. - Aim for ≥70% coverage on new modules. Add smoke tests for file parsing and queue/processing logic; use a non‑interactive Matplotlib backend for tests.
Commit & Pull Request Guidelines
- Commits: imperative mood with scope, e.g.,
gui: improve B‑scan update,datagen: add FOURIER mode. - PRs: include description, linked issues, reproduction steps, and screenshots/GIFs for UI changes. Keep changes focused and update docs when constants/paths change.
Configuration Tips
- Data paths are hardcoded; update before running on non‑Windows systems:
main.py:18—data_dir = r"D:\\data"datagen.py:11—DATA_DIR = r"D:\\data"
- Prefer a writable local path (e.g.,
/tmp/data) and do not commit generated data.