-
Notifications
You must be signed in to change notification settings - Fork 26
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
clarify resource identifier docs #1437
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1437 +/- ##
===========================================
- Coverage 88.54% 62.59% -25.95%
===========================================
Files 77 77
Lines 10561 10563 +2
===========================================
- Hits 9351 6612 -2739
- Misses 1210 3951 +2741
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
IMO with the explanation we could now trim that list way back to the common cases and include a linking to https://dandi.readthedocs.io/en/latest/ref/urls.html#resource-ids |
Added examples and cleaned it up a bit.
|
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
7702002
to
d8bae4d
Compare
1197cb0
to
16c41b6
Compare
dandi/cli/cmd_download.py
Outdated
EXAMPLES: \n | ||
# Download only the dandiset.yaml \n | ||
dandi download --download dandiset.yaml DANDI:000027 \n | ||
|
||
# Download only dandiset.yaml if there is a newer version \n | ||
dandi download https://identifiers.org/DANDI:000027 --existing refresh | ||
|
||
# Download only the assets \n | ||
dandi download --download assets DANDI:000027 | ||
|
||
# Download all from a specific version \n | ||
dandi download DANDI:000027/0.210831.2033 | ||
|
||
# Download a specific file or directory \n | ||
dandi download dandi://DANDI/000027@0.210831.2033/sub-RAT123/sub-RAT123.nwb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
what could trailing empty spaces would do besides in rare cases possibly negatively effecting wrapping?
-
also why bother with extra new line?
-
best to provide specific example for a directory since needs to end with
/
IIRC (please check that works)
EXAMPLES: \n | |
# Download only the dandiset.yaml \n | |
dandi download --download dandiset.yaml DANDI:000027 \n | |
# Download only dandiset.yaml if there is a newer version \n | |
dandi download https://identifiers.org/DANDI:000027 --existing refresh | |
# Download only the assets \n | |
dandi download --download assets DANDI:000027 | |
# Download all from a specific version \n | |
dandi download DANDI:000027/0.210831.2033 | |
# Download a specific file or directory \n | |
dandi download dandi://DANDI/000027@0.210831.2033/sub-RAT123/sub-RAT123.nwb | |
EXAMPLES:\n | |
# Download only the dandiset.yaml | |
dandi download --download dandiset.yaml DANDI:000027 | |
# Download only dandiset.yaml if there is a newer version | |
dandi download https://identifiers.org/DANDI:000027 --existing refresh | |
# Download only the assets | |
dandi download --download assets DANDI:000027 | |
# Download everything for a specific version of a dandiset | |
dandi download DANDI:000027/0.210831.2033 | |
# Download a specific directory | |
dandi download dandi://DANDI/000027@0.210831.2033/sub-RAT123/ | |
# Download a file | |
dandi download dandi://DANDI/000027@0.210831.2033/sub-RAT123/sub-RAT123.nwb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what could trailing empty spaces would do besides in rare cases possibly negatively effecting wrapping?
I just used them to separate the \n for human reading, but I dont feel strongly. Removed in latest commit.
also why bother with extra new line?
I'm not sure why, but a single newline is skipped, maybe something to do with the fstring?
dandi-cli/dandi/cli/cmd_download.py
Lines 15 to 16 in 15196a9
# The use of f-strings apparently makes this not a proper docstring, and so | |
# click doesn't use it unless we explicitly assign it to `help`: |
Your suggestion renders like this:
EXAMPLES:
# Download only the dandiset.yaml dandi download --download dandiset.yaml
DANDI:000027 # Download only dandiset.yaml if there is a newer version dandi
download https://identifiers.org/DANDI:000027 --existing refresh # Download
only the assets dandi download --download assets DANDI:000027 # Download
everything for a specific version of a dandiset dandi download
DANDI:000027/0.210831.2033 # Download a specific directory dandi download
dandi://DANDI/000027@0.210831.2033/sub-RAT123/ # Download a file dandi
download dandi://DANDI/000027@0.210831.2033/sub-RAT123/sub-RAT123.nwb
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
d3d4ec3
to
58c7c4c
Compare
Coolio, thank you! |
🚀 PR was released in |
I pulled the "primer" from https://dandi.readthedocs.io/en/latest/ref/urls.html#resource-ids
Do you think that helps enough?
(I also added to dandi_ls since it reused the same resource id doc)
$ dandi download --help