Fix data access to external resources#155
Merged
AndrewSazonov merged 4 commits intodevelopfrom Apr 14, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #155 +/- ##
===========================================
+ Coverage 82.90% 88.78% +5.88%
===========================================
Files 145 145
Lines 8418 8429 +11
Branches 854 855 +1
===========================================
+ Hits 6979 7484 +505
+ Misses 1150 675 -475
+ Partials 289 270 -19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates download_data() to fetch datasets via a pinned GitHub raw-content URL derived from an index “path” field (instead of consuming full external URLs directly), aligning data access with a more controlled/pinned resource layout.
Changes:
- Switched dataset index records from
urltopath, and added URL construction helpers (_build_data_url,_record_path). - Updated
download_data()to build the download URL from the record path and derive filenames from the record path suffix. - Updated unit tests to reflect the new index schema and URL construction behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/easydiffraction/utils/utils.py |
Builds dataset URLs from a repo/ref/root + record path; updates download_data() accordingly. |
tests/unit/easydiffraction/utils/test_utils_coverage.py |
Updates mocked dataset index records to use path instead of url. |
tests/unit/easydiffraction/test___init__.py |
Updates lazy-function test to assert download_data() calls pooch.retrieve with the constructed URL. |
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.