Repository navigation
Make simpeg.utils.download respect the verbose argument - #1777
Merged
Merged
Conversation
The download progress messages were printed unconditionally, so verbose=False only silenced the messages about preexisting files.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1777 +/- ##
=======================================
Coverage 81.74% 81.75%
=======================================
Files 425 425
Lines 55748 55773 +25
Branches 5295 5298 +3
=======================================
+ Hits 45572 45598 +26
Misses 8762 8762
+ Partials 1414 1413 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
santisoler
requested changes
Aug 25, 2026
santisoler
left a comment
Member
There was a problem hiding this comment.
Thanks @manduinca a lot for taking the time to work on this PR. I left a few comments below. Let me know what do you think!
Contributor
Author
|
Thanks for the review @santisoler! I applied all your suggestions: f-strings in the two prints and the explicit |
Member
|
Thanks a lot @manduinca! I'm merging this! 🚀 |
santisoler
approved these changes
Aug 31, 2026
simpeg.utils.download respect the verbose argument
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
simpeg.utils.downloadprinted its progress messages regardless of theverboseargument.PR Checklist
Reference issue
Closes #629
What does this implement/fix?
Only the messages about preexisting files were guarded by
verbose. The "Downloading ...", " saved to: ..." and "Download completed!" messages were printed unconditionally, soverbose=Falsedid not silence the function. I put the three remaining prints behind the same check.Additional information
The new tests mock
urllib.request.urlretrieveso they don't hit the network, and usecapsysto check the output. They live in a separate pytest class because the existingTestDownloadis aunittest.TestCase, which can't take thecapsysfixture. Both fail on main and pass with the change.I kept the
verboseflag instead of moving these messages to the SimPEG logger, to keep the change scoped to the issue. Happy to do that instead if you prefer.Squash and Merge Summary
Make
simpeg.utils.downloadto only print out messages to stdout ifverboseis True. Test the bugfix by mockingurllibto avoid requiring network connection.