Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Improve CLI help prompt in terminal (#166)
Browse files Browse the repository at this point in the history
* Improve CLI prompt message

* Cleanup sphinx doc
  • Loading branch information
You-Cyuan Jhang authored Apr 13, 2021
1 parent 9a7a40e commit 3b6529a
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 62 deletions.
58 changes: 32 additions & 26 deletions datasetinsights/commands/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@


class SourceURI(click.ParamType):
"""Source URI Parameter.
"""Represents the Source URI Parameter type.
Args:
click ([type]): [description]
This extends click.ParamType that allows click framework to validates
supported source URI according to the prefix pattern.
Raises:
click.BadParameter: [description]
Returns:
[type]: [description]
click.BadParameter: if the validation failed.
"""

name = "source_uri"
Expand Down Expand Up @@ -88,37 +85,46 @@ def cli(
source_uri, output, include_binary, access_token, checksum_file,
):
"""Download datasets to localhost from known locations.
The download command can support downloading from 3 sources
usim:// http(s):// gs://
Download from Unity Simulation:
The download command can support downloading from 3 types of sources
You can specify project_it, run_execution_id, access_token in source-uri
1. Download from Unity Simulation:
datasetinsights download
--source-uri=usim://<access_token>@<project_id>/<run_execution_id>
--output=$HOME/data
You can specify project_id, run_execution_id, access_token in source-uri:
Alternatively, you can also override access_token such as
\b
datasetinsights download \\
--source-uri=usim://<access_token>@<project_id>/<run_execution_id> \\
--output=$HOME/data
datasetinsights download --source-uri=usim://<project_id>/<run_execution_id>
--output=$HOME/data --access-token=<access_token>
Alternatively, you can also override access_token such as:
Downloading from a http source:
\b
datasetinsights download \\
--source-uri=usim://<project_id>/<run_execution_id> \\
--output=$HOME/data \\
--access-token=<access_token>
datasetinsights download --source-uri=http://url.to.file.zip
--output=$HOME/data
2. Downloading from a public http(s) url:
Downloading from a gcs source:
\b
datasetinsights download \\
--source-uri=http://url/to/file.zip \\
--output=$HOME/data
datasetinsights download --source-uri=gs://url/to/file.zip
--output=$HOME/data
3. Downloading from a GCS url:
or
\b
datasetinsights download \\
--source-uri=gs://url/to/file.zip \\
--output=$HOME/data
datasetinsights download --source-uri=gs://url/to/folder
--output=$HOME/data
or download all objects under the same directory:
\b
datasetinsights download \\
--source-uri=gs://url/to/directory \\
--output=$HOME/data
"""
ctx = click.get_current_context()
logger.debug(f"Called download command with parameters: {ctx.params}")
Expand Down
5 changes: 4 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ clean:
rm -rf $(BUILDDIR)

apidoc:
sphinx-apidoc --templatedir=$(TEMPLATEDIR) -o $(SOURCEDIR) -d 2 ../datasetinsights/ ../datasetinsights/stats/visualization ../datasetinsights/dashboard.py ../datasetinsights/datasets/protos
sphinx-apidoc --templatedir=$(TEMPLATEDIR) -o $(SOURCEDIR) -d 2 ../datasetinsights/ \
../datasetinsights/commands \
../datasetinsights/dashboard.py \
../datasetinsights/constants.py

html:
sphinx-build -b html $(SOURCEDIR) $(BUILDDIR)/html
Expand Down
24 changes: 0 additions & 24 deletions docs/source/datasetinsights.commands.rst

This file was deleted.

1 change: 1 addition & 0 deletions docs/source/datasetinsights.datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ datasetinsights.datasets

datasetinsights.datasets.unity_perception


datasetinsights.datasets.exceptions
-----------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/source/datasetinsights.io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ datasetinsights.io.gcs
:show-inheritance:



.. automodule:: datasetinsights.io
:members:
:undoc-members:
Expand Down
11 changes: 0 additions & 11 deletions docs/source/datasetinsights.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,11 @@ datasetinsights
.. toctree::
:maxdepth: 2

datasetinsights.commands
datasetinsights.datasets
datasetinsights.io
datasetinsights.stats


datasetinsights.constants
-------------------------

.. automodule:: datasetinsights.constants
:members:
:undoc-members:
:show-inheritance:



.. automodule:: datasetinsights
:members:
:undoc-members:
Expand Down
6 changes: 6 additions & 0 deletions docs/source/datasetinsights.stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ datasetinsights.stats
=====================


.. toctree::
:maxdepth: 2

datasetinsights.stats.visualization


datasetinsights.stats.statistics
--------------------------------

Expand Down
74 changes: 74 additions & 0 deletions docs/source/datasetinsights.stats.visualization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
datasetinsights.stats.visualization
===================================


datasetinsights.stats.visualization.app
---------------------------------------

.. automodule:: datasetinsights.stats.visualization.app
:members:
:undoc-members:
:show-inheritance:

datasetinsights.stats.visualization.bbox2d\_plot
------------------------------------------------

.. automodule:: datasetinsights.stats.visualization.bbox2d_plot
:members:
:undoc-members:
:show-inheritance:

datasetinsights.stats.visualization.bbox3d\_plot
------------------------------------------------

.. automodule:: datasetinsights.stats.visualization.bbox3d_plot
:members:
:undoc-members:
:show-inheritance:

datasetinsights.stats.visualization.constants
---------------------------------------------

.. automodule:: datasetinsights.stats.visualization.constants
:members:
:undoc-members:
:show-inheritance:

datasetinsights.stats.visualization.keypoints\_plot
---------------------------------------------------

.. automodule:: datasetinsights.stats.visualization.keypoints_plot
:members:
:undoc-members:
:show-inheritance:

datasetinsights.stats.visualization.object\_detection
-----------------------------------------------------

.. automodule:: datasetinsights.stats.visualization.object_detection
:members:
:undoc-members:
:show-inheritance:

datasetinsights.stats.visualization.overview
--------------------------------------------

.. automodule:: datasetinsights.stats.visualization.overview
:members:
:undoc-members:
:show-inheritance:

datasetinsights.stats.visualization.plots
-----------------------------------------

.. automodule:: datasetinsights.stats.visualization.plots
:members:
:undoc-members:
:show-inheritance:



.. automodule:: datasetinsights.stats.visualization
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 3b6529a

Please sign in to comment.