refactor reprocess_files partially #34#42
Merged
Conversation
…dling Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
…ted try-catch Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Co-authored-by: sahiljhawar <55475299+sahiljhawar@users.noreply.github.com>
Collaborator
Author
|
@copilot Review the code for bugs, type errors, etc |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors multiple data-ingestion modules to stop using wget and instead download via requests, while also adding “write to temp + replace” patterns to make output file writes more atomic and improving reprocess_files handling.
Changes:
- Replaced
wget.download(...)withrequests.get(...).raise_for_status()+ manual file writes across several IO modules. - Updated download/process flows to skip existing outputs when
reprocess_files=Falseand to write via*.tmpfiles before replacing final CSVs. - Updated unit tests/mocks accordingly and added OMNI low-res CSV fixture data.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/io/solar_wind/test_dscovr.py | Switches test download helper from wget to requests. |
| tests/io/solar_wind/test_ace.py | Updates download mocking to patch requests.get. |
| tests/io/omni/test_omni_low_res.py | Updates download mocking to patch requests.get. |
| tests/io/omni/data/OMNI_LOW_RES_2020.csv | Adds low-res OMNI CSV fixture for tests. |
| tests/io/kp/test_kp_omni.py | Updates download mocking to patch requests.get. |
| tests/io/hp/test_hp.py | Updates download mocking to patch requests.get. |
| tests/io/f10_7/test_f107omni.py | Updates download mocking to patch requests.get. |
| tests/io/dst/test_dst_omni.py | Updates download mocking to patch requests.get. |
| swvo/io/solar_wind/dscovr.py | Replaces wget with requests and adds tmp-file writes. |
| swvo/io/solar_wind/ace.py | Replaces wget with requests and adds tmp-file writes. |
| swvo/io/omni/omni_low_res.py | Replaces wget with requests and refactors per-file processing and reprocessing behavior. |
| swvo/io/kp/swpc.py | Replaces wget with requests, adds tmp-file writes, and simplifies reprocess handling. |
| swvo/io/kp/niemegk.py | Replaces wget with requests, adds tmp-file writes, and changes loop structure for processing intervals. |
| swvo/io/hp/gfz.py | Replaces wget with requests, adds tmp-file writes, and refactors download loop. |
| swvo/io/f10_7/swpc.py | Replaces wget with requests, adds tmp-file writes, and refactors cleanup. |
| swvo/io/dst/wdc.py | Replaces wget with requests, adds tmp-file writes, and refactors month processing loop. |
💡 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.
No description provided.