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

Make DownloadData be idempotent #25

Open
duetosymmetry opened this issue Aug 5, 2024 · 0 comments
Open

Make DownloadData be idempotent #25

duetosymmetry opened this issue Aug 5, 2024 · 0 comments

Comments

@duetosymmetry
Copy link
Collaborator

duetosymmetry commented Aug 5, 2024

DownloadData can skip downloading if the requested data already exists. That way it's safe to put a call to DownloadData at the beginning of a script, without the user doing any checks. This just requires testing the destination path's .exists(). Example (with an optional flag overwrite):

https://github.com/duetosymmetry/qnm/blob/9008d69b22d7bb708886cf8f5ffeef5fb5a29bf4/qnm/cached.py#L504-L534

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

No branches or pull requests

1 participant