From f2b03f66018a314397ccba909dea414b6f5e9a4b Mon Sep 17 00:00:00 2001 From: HansBug Date: Mon, 6 Sep 2021 12:28:57 +0800 Subject: [PATCH] dev(hansbug): Do some update in requirements && add api_doc page and installation_check page --- docs/source/_shims/.keep | 0 docs/source/api_doc/config/index.rst | 7 ++++ docs/source/api_doc/config/meta.rst | 38 +++++++++++++++++++ docs/source/index.rst | 34 ++++++++++------- docs/source/tutorials/installation/index.rst | 29 ++++++++++++++ .../installation/install_check.demo.py | 6 +++ requirements.txt | 1 - 7 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 docs/source/_shims/.keep create mode 100644 docs/source/api_doc/config/index.rst create mode 100644 docs/source/api_doc/config/meta.rst create mode 100644 docs/source/tutorials/installation/index.rst create mode 100644 docs/source/tutorials/installation/install_check.demo.py diff --git a/docs/source/_shims/.keep b/docs/source/_shims/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/docs/source/api_doc/config/index.rst b/docs/source/api_doc/config/index.rst new file mode 100644 index 000000000..38a67be7d --- /dev/null +++ b/docs/source/api_doc/config/index.rst @@ -0,0 +1,7 @@ +treetensor.config +===================== + +.. toctree:: + :maxdepth: 3 + + meta diff --git a/docs/source/api_doc/config/meta.rst b/docs/source/api_doc/config/meta.rst new file mode 100644 index 000000000..372ac233f --- /dev/null +++ b/docs/source/api_doc/config/meta.rst @@ -0,0 +1,38 @@ +treetensor.config.meta +========================== + +.. automodule:: treetensor.config.meta + +\_\_TITLE\_\_ +------------------ + +.. autodata:: treetensor.config.meta.__TITLE__ + :annotation: + + +\_\_VERSION\_\_ +------------------ + +.. autodata:: treetensor.config.meta.__VERSION__ + :annotation: + + +\_\_DESCRIPTION\_\_ +---------------------- + +.. autodata:: treetensor.config.meta.__DESCRIPTION__ + :annotation: + + +\_\_AUTHOR\_\_ +------------------ + +.. autodata:: treetensor.config.meta.__AUTHOR__ + :annotation: + + +\_\_AUTHOR_EMAIL\_\_ +---------------------- + +.. autodata:: treetensor.config.meta.__AUTHOR_EMAIL__ + :annotation: diff --git a/docs/source/index.rst b/docs/source/index.rst index 655e5dd73..5bc3c8b5f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,20 +1,28 @@ -.. DI-treetensor documentation master file, created by - sphinx-quickstart on Sun Sep 5 23:14:14 2021. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +Welcome to DI-TreeTensor's Documentation +================================================ + +Overview +------------- + +``DI-TreeTensor`` is a generalized tree-based tensor structure, \ +based on `treevalue `_ \ +module. + +.. toctree:: + :maxdepth: 2 + :caption: Tutorials + + tutorials/installation/index -Welcome to DI-treetensor's documentation! -========================================= .. toctree:: - :maxdepth: 2 - :caption: Contents: + :maxdepth: 2 + :caption: API Documentation + api_doc/config/index -Indices and tables -================== +.. toctree:: + :maxdepth: 2 + :caption: Contributor Guide -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/source/tutorials/installation/index.rst b/docs/source/tutorials/installation/index.rst new file mode 100644 index 000000000..585d7a80d --- /dev/null +++ b/docs/source/tutorials/installation/index.rst @@ -0,0 +1,29 @@ +Installation +=================== + +DI-treetensor is currently hosted on PyPI. It required python >= 3.6. + +You can simply install DI-treetensor from PyPI with the following command: + +.. code:: shell + + pip install di-treetensor + +You can also install with the newest version through GitHub: + +.. code:: shell + + pip install -U git+https://github.com/opendilab/DI-treetensor.git@main + +After installation, run this python code, and version information \ +of ``treetensor`` should be shown. + +.. literalinclude:: install_check.demo.py + :language: python + :linenos: + +.. literalinclude:: install_check.demo.py.txt + :language: text + :linenos: + +DI-treetensor is still under development, you can also check out the documents in stable version through `https://opendilab.github.io/DI-treetensor/ `_. diff --git a/docs/source/tutorials/installation/install_check.demo.py b/docs/source/tutorials/installation/install_check.demo.py new file mode 100644 index 000000000..562352d5c --- /dev/null +++ b/docs/source/tutorials/installation/install_check.demo.py @@ -0,0 +1,6 @@ +from treetensor.config.meta import __TITLE__, __VERSION__, __AUTHOR__, __DESCRIPTION__ + +if __name__ == '__main__': + print(__TITLE__, __VERSION__) + print(__DESCRIPTION__) + print('Powered by', __AUTHOR__) diff --git a/requirements.txt b/requirements.txt index 5e7965988..3058a06f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ treevalue>=0.1.0 -numpy>=1.10 torch>=1.3.1,<=1.8.0 -- GitLab