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

Slight tune up to formatting of examples etc to harmonize appearance/make shorter #1439

Merged
merged 1 commit into from
May 3, 2024

Conversation

yarikoptic
Copy link
Member

Original --help is too long and a little more inconsistent -- the "#" are shell script construct and generally not used to demarkate anything there, so kind no point to have/look odd

Here is how it would look now

❯ dandi download --help
Usage: dandi download [OPTIONS] [URL]...

  Download files or entire folders from DANDI.

  RESOURCE ID/URLS:

   dandi commands accept URLs and URL-like identifiers called <resource  ids>
   in the following formats for identifying Dandisets, assets, and  asset
   collections.

   Text in [brackets] is optional.  A server field is a base API or GUI URL
   for a DANDI Archive instance.  If an optional ``version`` field is  omitted
   from a URL, the given Dandiset's most recent published version  will be
   used if it has one, and its draft version will be used otherwise.

  Accepted resource identifier patterns:
   - DANDI:<dandiset id>[/<version>]
   - https://gui.dandiarchive.org/...
   - https://identifiers.org/DANDI:<dandiset id>[/<version id>] (<version id> cannot be 'draft')
   - https://<server>[/api]/[#/]dandiset/<dandiset id>[/<version>][/files[?location=<path>]]
   - https://*dandiarchive-org.netlify.app/...
   - https://<server>[/api]/dandisets/<dandiset id>[/versions[/<version>]]
   - https://<server>[/api]/assets/<asset id>[/download]
   - https://<server>[/api]/dandisets/<dandiset id>/versions/<version>/assets/<asset id>[/download]
   - https://<server>[/api]/dandisets/<dandiset id>/versions/<version>/assets/?path=<path>
   - https://<server>[/api]/dandisets/<dandiset id>/versions/<version>/assets/?glob=<glob>
   - dandi://<instance name>/<dandiset id>[@<version>][/<path>]
   - https://<server>/...

  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 all from a specific version
     dandi download DANDI:000027/0.210831.2033
  
   - Download a specific directory
     dandi download dandi://DANDI/000027@0.210831.2033/sub-RAT123/
  
   - Download a specific file
     dandi download dandi://DANDI/000027@0.210831.2033/sub-RAT123/sub-RAT123.nwb

Options:
  -o, --output-dir DIRECTORY      Directory where to download to (directory
                                  must exist). Files will be downloaded with
                                  paths relative to that directory.
  -e, --existing [error|skip|overwrite|overwrite-different|refresh]
                                  What to do if a file found existing locally.
                                  'refresh': verify that according to the size
                                  and mtime, it is the same file, if not -
                                  download and overwrite.  [default: error]
  -f, --format [pyout|debug]      Choose the format/frontend for output. TODO:
                                  support all of the ls
  --path-type [exact|glob]        Whether to interpret asset paths in URLs as
                                  exact matches or glob patterns  [default:
                                  exact]
  -J, --jobs N[:M]                Number of parallel download jobs and,
                                  optionally number of subjobs per Zarr asset
                                  [default: 6]
  --download [dandiset.yaml,assets,all]
                                  Comma-separated list of elements to download
                                  [default: all]
  --sync                          Delete local assets that do not exist on the
                                  server
  -i, --dandi-instance TEXT       DANDI Archive instance to download from. If
                                  any URLs are provided, they must point to
                                  the given instance. If no URL is provided,
                                  and there is a local dandiset.yaml file, the
                                  Dandiset with the identifier given in the
                                  file will be downloaded from the given
                                  instance.  [env var: DANDI_INSTANCE]
  --help                          Show this message and exit.

…make shorter

Original --help is too long and a little more inconsistent  -- the "#" are
shell script construct and generally not used to demarkate anything there, so
kind no point to have/look odd
@yarikoptic yarikoptic requested a review from asmacdo May 3, 2024 19:01
@yarikoptic yarikoptic added the patch Increment the patch version when merged label May 3, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.69%. Comparing base (260b4d7) to head (b477d41).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1439      +/-   ##
==========================================
+ Coverage   88.61%   88.69%   +0.08%     
==========================================
  Files          77       77              
  Lines       10563    10563              
==========================================
+ Hits         9360     9369       +9     
+ Misses       1203     1194       -9     
Flag Coverage Δ
unittests 88.69% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@asmacdo asmacdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@yarikoptic
Copy link
Member Author

ubuntu 3.12 fail is odd

FAILED dandi/cli/tests/test_shell_completion.py::test_shell_completion_sourceable - subprocess.CalledProcessError: Command '['bash', '-c', 'source <(dandi shell-completion)']' returned non-zero exit status 2.

and unlikely related... proceeding for now

@yarikoptic yarikoptic merged commit 87a3744 into master May 3, 2024
27 of 28 checks passed
@yarikoptic yarikoptic deleted the enh-indentation branch May 3, 2024 21:55
Copy link

🚀 PR was released in 0.62.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants