Refactor project structure, enhance CLI, and improve documentation - #4
Merged
Conversation
added 5 commits
April 27, 2026 11:26
Replaces legacy flat structure with modern src-layout packaging. Migrates from raw requirements.txt to pyproject.toml with entry points. Introduces Pydantic Settings for validated configuration management. Replaces argparse CLI with Typer supporting subcommands. Implements dependency injection via Analyzer orchestrator. Adds structured logging with structlog and single setup entry point. Extracts constants and adds full type hints across all modules. Converts event dataclasses to frozen Pydantic models. Introduces VisualizationStrategy protocol for GUI/headless modes. Adds EventBus pub/sub and CSV/JSON exporters for detections. Expands test suite to 60 tests with 85% coverage. Adds CI workflow with lint, typecheck and test matrix. Updates README with new installation and usage instructions.
…ation Adds detailed command explanations with all CLI options and defaults. Includes 6 practical examples for different use cases (FM radio, walkie-talkies, GSM, debug mode, remote server, custom configs). Documents configuration cascade (YAML → env vars → CLI flags). Adds signal patterns reference table and headless mode output examples.
read_samples() now truncates odd-length buffers to prevent reshape errors. HeadlessVisualization no longer catches KeyboardInterrupt internally, allowing the Analyzer's signal handler to cleanly break the loop on Ctrl+C.
- Remove SIGINT signal handler to let KeyboardInterrupt raise immediately, enabling instant Ctrl+C response without waiting for socket timeouts. - Keep SIGTERM handler for daemon mode compatibility. - Add exporter tracking in Analyzer with automatic close() in finally block. - Add CLI validation requiring --export-path when --export-format is set and vice versa, preventing silent export failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to project configuration, development workflow, and documentation, while also removing an outdated script. The main changes focus on establishing modern Python packaging and dependency management with
pyproject.toml, setting up continuous integration (CI) with GitHub Actions, and providing clear environment and configuration templates for easier setup. Additionally, a comprehensive skill document for code review and commit best practices is added. The legacyrun_analyzer.pyscript is removed, reflecting a shift to a more modular and maintainable structure.Project configuration and packaging:
pyproject.tomlfile to define project metadata, dependencies, development and test requirements, and tool configurations forruff,mypy, andpytest, enabling modern Python packaging and streamlined development workflows.config/default.yml, with revised default values for RTL-TCP and receiver parameters.Development workflow and CI:
.github/workflows/ci.yml) that runs linting, type checks, and tests (across Python 3.9–3.12), and uploads coverage reports to Codecov.Environment and documentation:
.env.examplefile with all relevant environment variables for RTL-SDR Analyzer setup, providing a template for user configuration..opencode/skills/code-review-commit/SKILL.md) outlining best practices for code review, branch management, and Conventional Commits, tailored for React and git workflows (in Spanish).Codebase cleanup:
scripts/run_analyzer.pyscript, indicating a move away from a monolithic entry point in favor of a more modular CLI and configuration-driven approach.src/__init__.pyandsrc/core/__init__.py, further streamlining the codebase. [1] [2]