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

Option to replace cache by an exportable persistent index #122

Open
jeandet opened this issue Feb 22, 2024 · 0 comments
Open

Option to replace cache by an exportable persistent index #122

jeandet opened this issue Feb 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jeandet
Copy link
Member

jeandet commented Feb 22, 2024

The current cache implementation automatically updates data which is a sane default behavior.
In some case, it could make sense to instead use a cache that doesn't update data and keep them forever, making a study reproducible.
An API for such cache might look like this:

from speasy.reproducibility import Index
# aliasing with spz should make usage transparent 
spz = Index("/some/path")
# here the expected behavior, is, take from index if present or request data and add to index
v = spz.get_data(...)
...
# users should be able to export their cache
spz.export_data("/some/path/archive.tgz")
...
# users should be able to import cache 
spz.import_data("/some/path/archive.tgz")
...
# at some point users should also be able to update data from cache
spz.update_all_data() 
# or
v = spz.get_data(..., refresh=True)
@jeandet jeandet added the enhancement New feature or request label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant