Fix review feedback and refresh README - #8
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request addresses prior review feedback by tightening spectrogram output naming rules, improving CLI error reporting for event-mode arguments, and refreshing documentation to reflect current workflows and availability semantics.
Changes:
- Add validation to reject
output_stemvalues that include paths or extensions, with regression tests. - Convert event-mode CLI argument validation to
argparseerrors (exit code 2) rather than raising exceptions. - Refresh README and inventory docs to reflect current workflows and define availability/coverage as archived interval overlap.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
onc_hydrophone_data/audio/spectrogram_generator.py |
Validates output_stem early to prevent path traversal and doubled extensions; updates docstring. |
scripts/generate_spectrograms.py |
Adds argparse-based validation for event-mode CLI flag combinations/values. |
tests/test_spectrogram_generator.py |
Adds regression tests ensuring invalid output_stem is rejected before creating output directories. |
tests/test_generate_spectrograms_cli.py |
Adds subprocess-based CLI tests asserting clean argparse errors without tracebacks. |
README.md / docs/inventory.md |
Updates documentation/examples for current workflows and correct coverage definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
655
to
+657
| args = parser.parse_args() | ||
|
|
||
| if args.event_time is not None: |
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
output_stemvalues that contain paths or file extensionsargparsewithout a tracebackWhy
Recent review comments identified two user-facing correctness issues in filename handling and CLI errors, plus inaccurate documentation of the availability metric. The README also needed to reflect the newly merged event and JSON workflows.
User impact
Invalid output stems now fail clearly instead of creating doubled extensions, CLI argument mistakes produce concise usage errors, and coverage values are documented according to their actual time-overlap calculation.
Validation
64 passed, 2 deselectedmkdocs build --strictgit diff --check