Skip to content
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

Check registry file hash before downloading #93

Merged
merged 15 commits into from
Apr 25, 2024

Conversation

OliviaLynn
Copy link
Collaborator

@OliviaLynn OliviaLynn commented Apr 18, 2024

For #54; checks the hash of the local registry file against the hash of the remote registry file to avoid unnecessary re-downloading of the registry file.

Note - the docs are failing because I've renamed the remote data-registry.txt to data_registry.txt to match our usage in lephare (default behavior is to save this file as data_registry.txt). Until we merge lephare-photoz/lephare-data#12, we won't be able to find this new file.

@OliviaLynn OliviaLynn marked this pull request as ready for review April 19, 2024 01:14
Copy link
Collaborator

@drewoldag drewoldag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I'm glad that you've got unit tests in place, but I'm not fully confident all the logic is exercised (I could be wrong). As mentioned in the comment, it might be worth expanding the unit tests, or possibly just noting which code paths aren't covered in some comments for later implementation.

src/lephare/data_retrieval.py Outdated Show resolved Hide resolved
@drewoldag drewoldag linked an issue Apr 22, 2024 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.94%. Comparing base (ef301e9) to head (49f7936).
Report is 184 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
- Coverage   23.26%   22.94%   -0.32%     
==========================================
  Files          14       47      +33     
  Lines         662     5883    +5221     
  Branches        0      934     +934     
==========================================
+ Hits          154     1350    +1196     
- Misses        508     4533    +4025     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OliviaLynn OliviaLynn requested a review from drewoldag April 24, 2024 22:15
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like the way you've documented the logic and the tests that cover it.

Copy link
Collaborator

@drewoldag drewoldag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, very clean code. Nice

else:
print(f"Local registry file is not up to date: {local_registry_file}")
return False
return remote_hash_response.text.strip() == local_registry_hash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@OliviaLynn OliviaLynn merged commit 5859c5c into main Apr 25, 2024
11 checks passed
@OliviaLynn OliviaLynn deleted the issue/54/registry-hash-file branch April 25, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make registry hash file
2 participants