ci: add strict type checking and resolve sysaudio path types#8
Merged
Conversation
- Implement `save_signal` with automatic timestamping and compressed .npz storage. - Add `load_signal` with legacy key support (signal vs data) to handle older captures. - Create `scan_metadata` utility to aggregate recording attributes into a Pandas DataFrame. - Add CLI-based file selection (`select_file_cli`) for interactive workflows.
- Update `load_signal` type signature to accept `pathlib.Path` in addition to `str`. - Resolve mypy errors when loading files defined via pathlib in analysis notebooks.
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.
Summary
This PR integrates static type checking into the CI pipeline using
mypyand resolves type compatibility issues within thesysaudiomodule to supportpathlib.Pathobjects.Changes
.github/workflows/ci.yml): Added a strict type-checking step (uv run mypy oscilloscope-rp2040) to the build job. This ensures all future commits adhere to the strict typing configuration defined inpyproject.toml.oscilloscope-rp2040/sysaudio/io.py): Updated the function signature ofload_signalto acceptUnion[str, Path]. This fixes type errors previously observed in analysis notebooks wherepathlib.Pathobjects were passed directly to the loader.Motivation
While
numpy.loadnatively handlesPathobjects, the explicit type hintfilepath: strin our wrapper causedmypyto flag valid usage in our analysis scripts (e.g.,04_transfer_analysis.ipynb). This change aligns the type hints with the actual runtime behavior and enforces this correctness automatically via GitHub Actions.