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

Add caching and create outputs as symlinks #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

petermcevoy
Copy link

Hi, here is a larger PR for changes to make cdsapi_helper download files into a central cache and then symlink outputs according to the input specification files.

The individual commits in this PR hopefully introduce the changes in smaller and more clear steps.
Let me know what you think and if it makes sense to include.

MVH
Peter

Alter the download_cds command to download files to a user specified
cache directory where files are named after
`get_json_sem_hash(request)`. The `RequestEntry` class is introduce to
keep the data necessary for producing the hash collected.

Output according to `filename_spec` are created using symlinks to the
cache.

Main motivation for this is to allow multiple projects that might
have overlapping data to re-use previously downloaded requests.
The mutually exclusive options to download_cds are split into click
subcommands:
- download
- list-files
- list-dangling
@Holmgren825
Copy link
Owner

Hey @petermcevoy ! Remembered that I should look at this 😄 Overall it looks really nice, and the core functionality should remain the same. I guess the bump to python 3.11 is because of using built-in tomli?

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.

2 participants