-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tropo_pyaps3
: add --debug-mode
option
#1322
Conversation
+ tropo_pyaps3.py: add --debug(--mode) option to enable the debug mode to show the full error message of pyaps3 while downloading + requirements.txt: set min version of pyaps3 to 0.3.6 for the new CDS website
Reviewer's Guide by SourceryThis pull request introduces a debug mode option for the tropo_pyaps3 process. The changes allow users to run pyaps3 in debug mode so that full error messages are shown without swallowing errors via retries, which aids in diagnosing issues. Additionally, the minimum required version of pyaps3 is updated to 0.3.6 to support the new CDS website. Sequence diagram for debug mode flow in tropo_pyaps3sequenceDiagram
participant User as actor User
participant CLI as CLI Parser
participant Main as run_tropo_pyaps3
participant DL as dload_grib_files
participant PA as pyaps3
User->>CLI: Provide CLI command with --debug flag
CLI->>Main: Parse arguments (debug_mode = True)
Main->>DL: Call dload_grib_files(..., debug_mode=True)
alt Debug Mode Enabled
DL->>PA: Call appropriate download function (ECMWFdload/MERRAdload/NARRdload) without retry
else Operation Mode
loop Up to 3 Attempts
DL->>PA: Call download function (wrapped in try/except)
PA-->>DL: Return result or error
alt Error Encountered
DL-->>DL: Print warning and retry if attempt < 3
end
end
end
DL-->>Main: Return downloaded grib files
Main-->>CLI: Continue processing
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR SummaryThis Pull Request introduces a new Review Checklist
SuggestionConsider adding unit tests or integration tests to verify the new This comment was generated by AI. Information provided may be incorrect. Current plan usage: 0% Have feedback or need help? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @yunjunz - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the download logic into a separate function to improve readability.
- It might be clearer to use
if not debug_mode:
instead ofelse:
to enclose the try/except block.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Description of proposed changes
tropo_pyaps3.py
: add--debug(--mode)
option to enable the debug mode to show the full error message ofpyaps3
while downloading, to better diagnose new pyaps0.3.6 can not download dataset #1321requirements.txt
: set min version ofpyaps3
to 0.3.6 for the new CDS websiteReminders
Summary by Sourcery
Add a
--debug-mode
option to show the full error message ofpyaps3
while downloading, and set the minimum version ofpyaps3
to 0.3.6.New Features:
--debug-mode
option totropo_pyaps3.py
to facilitate debugging of pyaps3 downloads.Tests:
--debug
option.