Skip to content

ci: add strict type checking and resolve sysaudio path types#8

Merged
JacksonFergusonDev merged 2 commits into
mainfrom
mypy
Jan 31, 2026
Merged

ci: add strict type checking and resolve sysaudio path types#8
JacksonFergusonDev merged 2 commits into
mainfrom
mypy

Conversation

@JacksonFergusonDev

@JacksonFergusonDev JacksonFergusonDev commented Jan 31, 2026

Copy link
Copy Markdown
Owner

Summary

This PR integrates static type checking into the CI pipeline using mypy and resolves type compatibility issues within the sysaudio module to support pathlib.Path objects.

Changes

  • CI Workflow (.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 in pyproject.toml.
  • Sysaudio I/O (oscilloscope-rp2040/sysaudio/io.py): Updated the function signature of load_signal to accept Union[str, Path]. This fixes type errors previously observed in analysis notebooks where pathlib.Path objects were passed directly to the loader.

Motivation

While numpy.load natively handles Path objects, the explicit type hint filepath: str in our wrapper caused mypy to 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.

- 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.
@JacksonFergusonDev JacksonFergusonDev changed the title feat(ci/sysaudio): integrate mypy and enhance I/O utilities ci: add strict type checking and resolve sysaudio path types Jan 31, 2026
@JacksonFergusonDev JacksonFergusonDev merged commit 45ae7e8 into main Jan 31, 2026
2 checks passed
@JacksonFergusonDev JacksonFergusonDev deleted the mypy branch January 31, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant