Address review feedback and improve examples - #5
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses prior review feedback by improving correctness of audio download summaries, hardening documentation figure generation (atomic writes + content-type validation), and updating docs/examples to be self-contained and aligned with the “audio-first” workflow.
Changes:
- Refines audio download summary semantics by separating newly downloaded files from locally available/skipped files.
- Makes docs-figure audio download atomic and validates ONC response status/content type; improves Pillow compatibility and temp-file cleanup.
- Updates README/MkDocs examples to include shared setup blocks and fixes long-range sampling examples; ignores generated MkDocs
site/output.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_plot_layouts.py | Adds tolerance to legend placement assertion and adds regression coverage for missing last-bin start in calendar plotting. |
| tests/test_download_efficiency.py | Updates expectations for new download summary semantics and adds coverage for newly-downloaded vs available counts. |
| tests/test_docs_figure_generation.py | Adds focused tests for atomic ONC audio preview download and content-type rejection. |
| scripts/generate_docs_figures.py | Improves Pillow resampling compatibility, ensures temp cleanup, and makes ONC preview download atomic with validation. |
| README.md | Updates “Quick Start” to the audio-first workflow and aligns CLI examples/device/date paths. |
| pyproject.toml | Uses structured TOML list for pytest addopts (aligned with pytest>=8). |
| onc_hydrophone_data/utils/plotting.py | Hardens calendar plotting when last bin start is missing (returns None cleanly). |
| onc_hydrophone_data/data/downloader/onc_downloads.py | Adds files_available and corrects downloaded-vs-skipped semantics in audio download summary. |
| docs/troubleshooting.md | Clarifies reuse of the same downloader instance and fixes missing import in an example. |
| docs/onc_spectrogram_options.md | Makes examples self-contained with shared setup and clearer starter range guidance. |
| docs/downloads.md | Adds shared setup block and adjusts sampling/audio examples to be copy/paste runnable. |
| docs/custom_spectrograms.md | Makes the example self-contained by including downloader/config setup. |
| docs/audio_downloads.md | Adds shared setup variables and fixes sampling example variables for usability. |
| .gitignore | Ignores generated MkDocs site/ output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What changed
Why
Copilot review comments across the recent documentation and performance PRs identified several genuine correctness, compatibility, and copy/paste usability issues. The broader audit also found a misleading long-range sampling example and an outdated README entry path.
Impact
Download summaries now accurately distinguish work performed from files already present, documentation generation fails with clear errors for invalid ONC responses, and first-time users can run the documented workflows without guessing setup variables.
Validation
pytest -q: 51 passed, 2 integration tests deselectedmkdocs build --strict: passedpython -m compileall -q onc_hydrophone_data scripts tests: passedpython -m pip check: passed