-
Notifications
You must be signed in to change notification settings - Fork 30
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 file download functinality to ERDDAP #330
Conversation
We could compute a hash based on the constraints and add it to the file name. That could be useful for folks who will download multiple files requests from the same dataset_id programatically.
What do you mean? Are you counting with ERDDAP's error message? Maybe we can restrict this to valid known file types. |
Good idea with the hash, I've added that functionality. Currently, if you request a filetype that ERDDAP does not have, it will send the request and return an HTTP 400 error. Is this a desired outcome? Or would it be better to catch with a pre-defined list of allowed filetypes? Somthing like:
|
Looks like the IOOS ERDDAP is down, which is crashing the tests. I'll add more tests for this functionality |
Pinging @MathewBiddle here. Maybe it is a scheduled maintenance. |
@callumrollo everything is back online now. Thanks @MathewBiddle for getting the server back up. |
That the good thing about working with others. I would never thought of that but, because you raised the issue, I had to think of a solution.
I'm inclined to the latter b/c the former, while more elegant, is not consistent. Not all ERDDAP servers return the same error code. @abkfenris has some code to catch that if you want to try but I'm inclined to just create a list of allowed file types for download. |
I've recently refactored the error handling out into it's own file a bit better if you want an idea of what that might look like: https://github.com/gulfofmaine/buoy_barn/blob/main/app/deployments/tasks/error_handling.py |
Looks great! Thanks @callumrollo!! Do you want to add anything else or should we merge it? |
Looks good to me! Merge away |
Thanks @callumrollo! This turned out way better than what I wanted to implement. |
This adds a basic method to download files from erddap with a user specified file extension.
Envisaged usage:
This enables the usage of existing subsetting and constraints.
Limitations:
<dataset_id>.<extension>