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

Simplify startup when using remote inventory #49

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

sandorkertesz
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@cacf289). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #49   +/-   ##
=======================================
  Coverage        ?   93.07%           
=======================================
  Files           ?        8           
  Lines           ?      289           
  Branches        ?        7           
=======================================
  Hits            ?      269           
  Misses          ?       18           
  Partials        ?        2           

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

@sandorkertesz
Copy link
Collaborator Author

sandorkertesz commented Dec 18, 2024

This PR changes the way the matrix index file is managed when using remote matrix inventory. With the PR:

  • on startup, if the index file is not in the cache it is automatically downloaded
  • when calling interpolate() and the matrix is not registered in the inventory it compares the checksum of the remote and local (cached) index files. This involves the downloading the remote checksum. If the two checksums are different downloads the remote index file. If the matrix is still not registered in the index file raises an exception.

Previously, the remote and local checksums were always compared on startup and the index file was updated when the checksums were different. Since it always involved the downloading of the checksum file caused an unwanted external dependency/network access on each startup.

With this PR, this dependency is removed and if the necessary matrices are already cached earthkit-regrid will not download anything from remote urls.

@sandorkertesz sandorkertesz merged commit 271c989 into main Dec 19, 2024
105 checks passed
@sandorkertesz sandorkertesz deleted the feature/simplify-startup branch December 19, 2024 10:29
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.

None yet

2 participants