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

added explicit download file functions #384

Merged
merged 2 commits into from
May 27, 2022
Merged

Conversation

tylerflex
Copy link
Collaborator

@tylerflex tylerflex commented May 26, 2022

Before, there was a single web.download() function that grabbed the entire .hdf5.

The private web._download_file() could grab individual files from the server if the user knew the path.

This file also didn't try to authenticate, and would fail without a useful warning if trying to do so without calling another webapi function first.

This PR adds web.download_log(), web.download_json(), web.download_simulation() -> Simulation functions for explicitly grabbing the files a user would want. The last function is for convenience to avoid needing to then load the file into Simulation (could remove it).

Also, the authentication bits (and checking of task status) were moved into _download_file() so they are always called.

Note: Tested by importing and calling each of these functions on a specific task.
Also tested by running WebAPI.ipynb notebook.

@tylerflex tylerflex merged commit 8864daf into develop May 27, 2022
@tylerflex tylerflex deleted the tyler/download_file branch May 27, 2022 17:11
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.

Problems when downloading results using _download_file()
3 participants