-
Notifications
You must be signed in to change notification settings - Fork 67
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
earthaccess.download()
local_path
parameter is typed as Optional, but doesn't have a default value
#551
Comments
There is already a default, which shows up here: https://github.com/nsidc/earthaccess/blob/main/earthaccess/store.py#L467-L470 In |
Ah nice, even better :) Do we like that choice ( The thing that rubs me the wrong way about that default is the |
I agree. I don't like the Regarding the suffix, I'd get rid of the uuid and simply use HH-MM-SS in place of uuid. That ensures that the directories have a sensible sort order. I'm not a fan of defaulting to the current directory, as that makes it all too easy for large files to be accidentally committed to a repo. Perhaps defaulting to |
💯 |
I think
|
Indeed! From a user point of view, I would like to see a collection/dataset name in a directory. So, if there are many downloads for that time, they won't end up in the same folder. |
My preference, which doesn't align here, would be to just plop stuff in the current working directory if I don't specify a directory. I generally dislike "random" directory structures showing up and find it confusing to find my data in different contexts. Edit: And I would especially find a new directory showing up in my home directory confusing and wholly removed from the context I'm running the code in. |
I can see this perspective as well. I could be convinced to simply default to the current directory. I would actually prefer no default at all, requiring the user to always specify the directory explicitly, but that would present a breaking change at this point. Since we are pre-1.0, that wouldn't be the worst thing to do, but not ideal either. |
To expand, the default only supports the case where you don't specify where the data should go. In that case, when I go looking for the data, I think the current working directory is the most obvious, some sub-directory is still findable, and an entirely different location on my system would be the least obvious. |
I don't mind home directory in general, but I really don't like adding a non-dot directory to the root of home. It's a pet peeve :)
Agreed. And I think this is the most platform-agnostic approach. What does adding a directory to a user's "home" looks like on Windows? I don't know :)
Isn't this the current behavior? Although the type annotations disagree, you must pass in a |
Ha! Yes, that's true. Since there is no default parameter value, callers must supply a value, which is the whole point of this issue (facepalm). In that case, my preference would be to simply correct the type annotation by removing |
I'm fine with it being a required parameter. |
We think it should default to the current directory so if a user runs
earthaccess.download(results)
the files go somewhere somewhat intuitive.The text was updated successfully, but these errors were encountered: