From 1f0306c868002f51dbb1ca35df39b6820468e74d Mon Sep 17 00:00:00 2001 From: troyyyyy Date: Mon, 27 Nov 2023 13:43:18 +0800 Subject: [PATCH] [ENH] add auto docs --- docs/ABL/Abductive Learning.rst | 5 ---- docs/ABL/Quick Start.rst | 52 --------------------------------- docs/ABL/Test.md | 5 ---- docs/Examples/MNISTadd.rst | 3 -- docs/Makefile | 10 +++---- docs/abl.bridge.rst | 29 ++++++++++++++++++ docs/abl.dataset.rst | 45 ++++++++++++++++++++++++++++ docs/abl.evaluation.rst | 37 +++++++++++++++++++++++ docs/abl.learning.rst | 29 ++++++++++++++++++ docs/abl.reasoning.rst | 29 ++++++++++++++++++ docs/abl.rst | 24 +++++++++++++++ docs/abl.structures.rst | 29 ++++++++++++++++++ docs/abl.utils.rst | 45 ++++++++++++++++++++++++++++ docs/conf.py | 37 ++++++++++++++++++----- docs/index.rst | 26 ++++++++++------- docs/make.bat | 25 +++++++--------- docs/setup.rst | 7 +++++ 17 files changed, 335 insertions(+), 102 deletions(-) delete mode 100644 docs/ABL/Abductive Learning.rst delete mode 100644 docs/ABL/Quick Start.rst delete mode 100644 docs/ABL/Test.md delete mode 100644 docs/Examples/MNISTadd.rst create mode 100644 docs/abl.bridge.rst create mode 100644 docs/abl.dataset.rst create mode 100644 docs/abl.evaluation.rst create mode 100644 docs/abl.learning.rst create mode 100644 docs/abl.reasoning.rst create mode 100644 docs/abl.rst create mode 100644 docs/abl.structures.rst create mode 100644 docs/abl.utils.rst create mode 100644 docs/setup.rst diff --git a/docs/ABL/Abductive Learning.rst b/docs/ABL/Abductive Learning.rst deleted file mode 100644 index 47537b3..0000000 --- a/docs/ABL/Abductive Learning.rst +++ /dev/null @@ -1,5 +0,0 @@ ------------------------------ -Abductive Learning ------------------------------ - -What is ABL \ No newline at end of file diff --git a/docs/ABL/Quick Start.rst b/docs/ABL/Quick Start.rst deleted file mode 100644 index 4c7da0a..0000000 --- a/docs/ABL/Quick Start.rst +++ /dev/null @@ -1,52 +0,0 @@ ---------------- -Quick Start ---------------- - -How to use - -.. contents:: Table of Contents - -Required packages ------------------ - -This package requires the following packages: - -- Python version above 3.x -- ``numpy`` http://www.numpy.org - -The easiest way to get these is to use -`pip `__ or -`conda `__ environment -manager. Typing the following command in your terminal will install all -required packages in your Python environment. - -.. code:: console - - $ conda install numpy - -or - -.. code:: console - - $ pip install numpy - -Getting and installing ABL ----------------------------- - -The easiest way to install ABL is to type ``pip install ABL`` in you -terminal/command line. - -If you want to install ABL by source code, download this project and -sequentially run following commands in your terminal/command line. - -.. code:: console - - $ python setup.py build - $ python setup.py install - -A quick example ---------------- - -Show an example. - -More examples are available in the **Example** part. diff --git a/docs/ABL/Test.md b/docs/ABL/Test.md deleted file mode 100644 index cb0c801..0000000 --- a/docs/ABL/Test.md +++ /dev/null @@ -1,5 +0,0 @@ -# Test md - - -1. md -2. `code` \ No newline at end of file diff --git a/docs/Examples/MNISTadd.rst b/docs/Examples/MNISTadd.rst deleted file mode 100644 index c958334..0000000 --- a/docs/Examples/MNISTadd.rst +++ /dev/null @@ -1,3 +0,0 @@ -------------------------------------- -MNISTadd -------------------------------------- diff --git a/docs/Makefile b/docs/Makefile index 9a4183c..d4bb2cb 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,12 +1,12 @@ # Minimal makefile for Sphinx documentation # -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SPHINXPROJ = ABL +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build SOURCEDIR = . -BUILDDIR = build +BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: diff --git a/docs/abl.bridge.rst b/docs/abl.bridge.rst new file mode 100644 index 0000000..a1a7c3c --- /dev/null +++ b/docs/abl.bridge.rst @@ -0,0 +1,29 @@ +abl.bridge package +================== + +Submodules +---------- + +abl.bridge.base\_bridge module +------------------------------ + +.. automodule:: abl.bridge.base_bridge + :members: + :undoc-members: + :show-inheritance: + +abl.bridge.simple\_bridge module +-------------------------------- + +.. automodule:: abl.bridge.simple_bridge + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: abl.bridge + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/abl.dataset.rst b/docs/abl.dataset.rst new file mode 100644 index 0000000..330888a --- /dev/null +++ b/docs/abl.dataset.rst @@ -0,0 +1,45 @@ +abl.dataset package +=================== + +Submodules +---------- + +abl.dataset.bridge\_dataset module +---------------------------------- + +.. automodule:: abl.dataset.bridge_dataset + :members: + :undoc-members: + :show-inheritance: + +abl.dataset.classification\_dataset module +------------------------------------------ + +.. automodule:: abl.dataset.classification_dataset + :members: + :undoc-members: + :show-inheritance: + +abl.dataset.prediction\_dataset module +-------------------------------------- + +.. automodule:: abl.dataset.prediction_dataset + :members: + :undoc-members: + :show-inheritance: + +abl.dataset.regression\_dataset module +-------------------------------------- + +.. automodule:: abl.dataset.regression_dataset + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: abl.dataset + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/abl.evaluation.rst b/docs/abl.evaluation.rst new file mode 100644 index 0000000..482f0ba --- /dev/null +++ b/docs/abl.evaluation.rst @@ -0,0 +1,37 @@ +abl.evaluation package +====================== + +Submodules +---------- + +abl.evaluation.base\_metric module +---------------------------------- + +.. automodule:: abl.evaluation.base_metric + :members: + :undoc-members: + :show-inheritance: + +abl.evaluation.semantics\_metric module +--------------------------------------- + +.. automodule:: abl.evaluation.semantics_metric + :members: + :undoc-members: + :show-inheritance: + +abl.evaluation.symbol\_metric module +------------------------------------ + +.. automodule:: abl.evaluation.symbol_metric + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: abl.evaluation + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/abl.learning.rst b/docs/abl.learning.rst new file mode 100644 index 0000000..ea46f73 --- /dev/null +++ b/docs/abl.learning.rst @@ -0,0 +1,29 @@ +abl.learning package +==================== + +Submodules +---------- + +abl.learning.abl\_model module +------------------------------ + +.. automodule:: abl.learning.abl_model + :members: + :undoc-members: + :show-inheritance: + +abl.learning.basic\_nn module +----------------------------- + +.. automodule:: abl.learning.basic_nn + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: abl.learning + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/abl.reasoning.rst b/docs/abl.reasoning.rst new file mode 100644 index 0000000..db82a85 --- /dev/null +++ b/docs/abl.reasoning.rst @@ -0,0 +1,29 @@ +abl.reasoning package +===================== + +Submodules +---------- + +abl.reasoning.kb module +----------------------- + +.. automodule:: abl.reasoning.kb + :members: + :undoc-members: + :show-inheritance: + +abl.reasoning.reasoner module +----------------------------- + +.. automodule:: abl.reasoning.reasoner + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: abl.reasoning + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/abl.rst b/docs/abl.rst new file mode 100644 index 0000000..63922ac --- /dev/null +++ b/docs/abl.rst @@ -0,0 +1,24 @@ +abl package +=========== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + abl.bridge + abl.dataset + abl.evaluation + abl.learning + abl.reasoning + abl.structures + abl.utils + +Module contents +--------------- + +.. automodule:: abl + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/abl.structures.rst b/docs/abl.structures.rst new file mode 100644 index 0000000..88229af --- /dev/null +++ b/docs/abl.structures.rst @@ -0,0 +1,29 @@ +abl.structures package +====================== + +Submodules +---------- + +abl.structures.base\_data\_element module +----------------------------------------- + +.. automodule:: abl.structures.base_data_element + :members: + :undoc-members: + :show-inheritance: + +abl.structures.list\_data module +-------------------------------- + +.. automodule:: abl.structures.list_data + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: abl.structures + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/abl.utils.rst b/docs/abl.utils.rst new file mode 100644 index 0000000..e340f3a --- /dev/null +++ b/docs/abl.utils.rst @@ -0,0 +1,45 @@ +abl.utils package +================= + +Submodules +---------- + +abl.utils.cache module +---------------------- + +.. automodule:: abl.utils.cache + :members: + :undoc-members: + :show-inheritance: + +abl.utils.logger module +----------------------- + +.. automodule:: abl.utils.logger + :members: + :undoc-members: + :show-inheritance: + +abl.utils.manager module +------------------------ + +.. automodule:: abl.utils.manager + :members: + :undoc-members: + :show-inheritance: + +abl.utils.utils module +---------------------- + +.. automodule:: abl.utils.utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: abl.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py index 25bd78e..9b5f864 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,10 @@ -# -*- coding: utf-8 -*- +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information import sys import os import re @@ -14,11 +19,12 @@ from sphinx_rtd_theme import __version__ project = u'ABL' slug = re.sub(r'\W+', '-', project.lower()) -author = u'Yu-Xuan Huang, Wen-Chao Hu, En-Hao Gao' -version = u'0.1.0' -release = u'0.1.0' -copyright = u'2023, LAMDA, Nanjing University, China' -language = 'en' +project = 'ABL-Package' +copyright = '2023, Author' +author = 'Author' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ 'sphinx.ext.intersphinx', @@ -30,6 +36,22 @@ extensions = [ 'sphinx_markdown_tables', ] +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +language = 'en' + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'sphinx_rtd_theme' +html_theme_options = { + 'display_version': True +} + +# -- Options for todo extension ---------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html#configuration + templates_path = ['_templates'] source_suffix = ['.rst', '.md'] exclude_patterns = [] @@ -67,7 +89,6 @@ texinfo_documents = [ ('index', slug, project, author, slug, project, 'Miscellaneous'), ] - # Extensions to theme docs def setup(app): from sphinx.domains.python import PyField @@ -93,4 +114,4 @@ def setup(app): names=('default',), ), ] - ) + ) \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 37953e8..6ecfba3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,16 +1,22 @@ -.. include:: README.rst +.. ABL-Package documentation master file, created by + sphinx-quickstart on Mon Nov 27 13:13:16 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to ABL-Package's documentation! +======================================= .. toctree:: - :caption: Tutorial of ABL - :maxdepth: 2 + :maxdepth: 4 + :caption: Contents: - ABL/Abductive Learning.rst - ABL/Quick Start.rst - ABL/Test.md + abl + setup -.. toctree:: - :caption: Examples - :maxdepth: 2 - Examples/MNISTadd.rst +Indices and tables +================== +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat index bc934aa..32bb245 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -5,34 +5,31 @@ pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=python -msphinx + set SPHINXBUILD=sphinx-build ) -set SPHINXOPTS= -set SPHINXBUILD=sphinx-build set SOURCEDIR=. -set BUILDDIR=build -set SPHINXPROJ=ReadtheDocsSphinxTheme - -if "%1" == "" goto help +set BUILDDIR=_build %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. - echo.The Sphinx module was not found. Make sure you have Sphinx installed, - echo.then set the SPHINXBUILD environment variable to point to the full - echo.path of the 'sphinx-build' executable. Alternatively you may add the - echo.Sphinx directory to PATH. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end :help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% :end popd diff --git a/docs/setup.rst b/docs/setup.rst new file mode 100644 index 0000000..552eb49 --- /dev/null +++ b/docs/setup.rst @@ -0,0 +1,7 @@ +setup module +============ + +.. automodule:: setup + :members: + :undoc-members: + :show-inheritance: