From a7a9fc34b4b9c47c4869a738ad8404766be7499f Mon Sep 17 00:00:00 2001 From: ChenXin Date: Fri, 26 Apr 2019 13:11:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Makefile | 2 +- docs/source/conf.py | 32 ++++++++----- docs/source/fastNLP.api.rst | 12 +++-- docs/source/fastNLP.automl.rst | 44 ++++++++++++++++++ docs/source/fastNLP.component.rst | 20 +++++++++ docs/source/fastNLP.core.rst | 12 +++-- docs/source/fastNLP.io.rst | 36 +++++++-------- docs/source/fastNLP.models.rst | 52 +++++++++++----------- docs/source/fastNLP.modules.aggregator.rst | 42 ++++------------- docs/source/fastNLP.modules.decoder.rst | 12 +++-- docs/source/fastNLP.modules.encoder.rst | 42 +++++++++-------- docs/source/fastNLP.modules.rst | 16 +++---- docs/source/fastNLP.rst | 13 +++--- 13 files changed, 189 insertions(+), 146 deletions(-) create mode 100644 docs/source/fastNLP.automl.rst create mode 100644 docs/source/fastNLP.component.rst diff --git a/docs/Makefile b/docs/Makefile index 6a2ed12a..3050e655 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,7 +14,7 @@ help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) apidoc: - @$(SPHINXAPIDOC) -fM -o source ../fastNLP + $(SPHINXAPIDOC) -fM -o source ../$(SPHINXPROJ) server: cd build/html && python -m http.server diff --git a/docs/source/conf.py b/docs/source/conf.py index 96f7f437..5fd9e56d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,6 +14,7 @@ # import os import sys + sys.path.insert(0, os.path.abspath('../../')) # -- Project information ----------------------------------------------------- @@ -27,7 +28,6 @@ version = '0.4' # The full version, including alpha/beta/rc tags release = '0.4' - # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -42,9 +42,15 @@ extensions = [ 'sphinx.ext.viewcode', 'sphinx.ext.autosummary', 'sphinx.ext.mathjax', - + 'sphinx.ext.todo' ] +autodoc_default_options = { + 'member-order': 'bysource', + 'special-members': '__init__', + 'undoc-members': True, +} + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -72,7 +78,6 @@ exclude_patterns = ['modules.rst'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' - # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -107,22 +112,21 @@ html_static_path = ['_static'] # Output file base name for HTML help builder. htmlhelp_basename = 'fastNLPdoc' - # -- Options for LaTeX output ------------------------------------------------ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', - + # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', - + # Additional stuff for the LaTeX preamble. # # 'preamble': '', - + # Latex figure (float) alignment # # 'figure_align': 'htbp', @@ -136,7 +140,6 @@ latex_documents = [ 'xpqiu', 'manual'), ] - # -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples @@ -146,7 +149,6 @@ man_pages = [ [author], 1) ] - # -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples @@ -159,4 +161,14 @@ texinfo_documents = [ ] -# -- Extension configuration ------------------------------------------------- \ No newline at end of file +# -- Extension configuration ------------------------------------------------- +def maybe_skip_member(app, what, name, obj, skip, options): + if name.startswith("_"): + return True + if obj.__doc__ is None: + return True + return False + + +def setup(app): + app.connect('autodoc-skip-member', maybe_skip_member) diff --git a/docs/source/fastNLP.api.rst b/docs/source/fastNLP.api.rst index ee2413fb..955eb8c5 100644 --- a/docs/source/fastNLP.api.rst +++ b/docs/source/fastNLP.api.rst @@ -1,6 +1,11 @@ fastNLP.api package =================== +.. automodule:: fastNLP.api + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- @@ -53,10 +58,3 @@ fastNLP.api.utils module :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.api - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.automl.rst b/docs/source/fastNLP.automl.rst new file mode 100644 index 00000000..3c12e271 --- /dev/null +++ b/docs/source/fastNLP.automl.rst @@ -0,0 +1,44 @@ +fastNLP.automl package +====================== + +.. automodule:: fastNLP.automl + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +fastNLP.automl.enas\_controller module +-------------------------------------- + +.. automodule:: fastNLP.automl.enas_controller + :members: + :undoc-members: + :show-inheritance: + +fastNLP.automl.enas\_model module +--------------------------------- + +.. automodule:: fastNLP.automl.enas_model + :members: + :undoc-members: + :show-inheritance: + +fastNLP.automl.enas\_trainer module +----------------------------------- + +.. automodule:: fastNLP.automl.enas_trainer + :members: + :undoc-members: + :show-inheritance: + +fastNLP.automl.enas\_utils module +--------------------------------- + +.. automodule:: fastNLP.automl.enas_utils + :members: + :undoc-members: + :show-inheritance: + + diff --git a/docs/source/fastNLP.component.rst b/docs/source/fastNLP.component.rst new file mode 100644 index 00000000..81fcf561 --- /dev/null +++ b/docs/source/fastNLP.component.rst @@ -0,0 +1,20 @@ +fastNLP.component package +========================= + +.. automodule:: fastNLP.component + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +fastNLP.component.bert\_tokenizer module +---------------------------------------- + +.. automodule:: fastNLP.component.bert_tokenizer + :members: + :undoc-members: + :show-inheritance: + + diff --git a/docs/source/fastNLP.core.rst b/docs/source/fastNLP.core.rst index 79d26c76..540bd03c 100644 --- a/docs/source/fastNLP.core.rst +++ b/docs/source/fastNLP.core.rst @@ -1,6 +1,11 @@ fastNLP.core package ==================== +.. automodule:: fastNLP.core + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- @@ -117,10 +122,3 @@ fastNLP.core.vocabulary module :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.core - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.io.rst b/docs/source/fastNLP.io.rst index e677b50a..1eb95c6a 100644 --- a/docs/source/fastNLP.io.rst +++ b/docs/source/fastNLP.io.rst @@ -1,51 +1,56 @@ fastNLP.io package ================== +.. automodule:: fastNLP.io + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- -fastNLP.io.base_loader module ------------------------------ +fastNLP.io.base\_loader module +------------------------------ .. automodule:: fastNLP.io.base_loader :members: :undoc-members: :show-inheritance: -fastNLP.io.config_io module ---------------------------- +fastNLP.io.config\_io module +---------------------------- .. automodule:: fastNLP.io.config_io :members: :undoc-members: :show-inheritance: -fastNLP.io.dataset_loader module --------------------------------- +fastNLP.io.dataset\_loader module +--------------------------------- .. automodule:: fastNLP.io.dataset_loader :members: :undoc-members: :show-inheritance: -fastNLP.io.embed_loader module ------------------------------- +fastNLP.io.embed\_loader module +------------------------------- .. automodule:: fastNLP.io.embed_loader :members: :undoc-members: :show-inheritance: -fastNLP.io.file_reader module ------------------------------ +fastNLP.io.file\_reader module +------------------------------ .. automodule:: fastNLP.io.file_reader :members: :undoc-members: :show-inheritance: -fastNLP.io.model_io module --------------------------- +fastNLP.io.model\_io module +--------------------------- .. automodule:: fastNLP.io.model_io :members: @@ -53,10 +58,3 @@ fastNLP.io.model_io module :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.io - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.models.rst b/docs/source/fastNLP.models.rst index ccf6abb2..18b8186f 100644 --- a/docs/source/fastNLP.models.rst +++ b/docs/source/fastNLP.models.rst @@ -1,11 +1,16 @@ fastNLP.models package ====================== +.. automodule:: fastNLP.models + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- -fastNLP.models.base_model module --------------------------------- +fastNLP.models.base\_model module +--------------------------------- .. automodule:: fastNLP.models.base_model :members: @@ -20,64 +25,64 @@ fastNLP.models.bert module :undoc-members: :show-inheritance: -fastNLP.models.biaffine_parser module -------------------------------------- +fastNLP.models.biaffine\_parser module +-------------------------------------- .. automodule:: fastNLP.models.biaffine_parser :members: :undoc-members: :show-inheritance: -fastNLP.models.char_language_model module ------------------------------------------ +fastNLP.models.char\_language\_model module +------------------------------------------- .. automodule:: fastNLP.models.char_language_model :members: :undoc-members: :show-inheritance: -fastNLP.models.cnn_text_classification module ---------------------------------------------- +fastNLP.models.cnn\_text\_classification module +----------------------------------------------- .. automodule:: fastNLP.models.cnn_text_classification :members: :undoc-members: :show-inheritance: -fastNLP.models.enas_controller module -------------------------------------- +fastNLP.models.enas\_controller module +-------------------------------------- .. automodule:: fastNLP.models.enas_controller :members: :undoc-members: :show-inheritance: -fastNLP.models.enas_model module --------------------------------- +fastNLP.models.enas\_model module +--------------------------------- .. automodule:: fastNLP.models.enas_model :members: :undoc-members: :show-inheritance: -fastNLP.models.enas_trainer module ----------------------------------- +fastNLP.models.enas\_trainer module +----------------------------------- .. automodule:: fastNLP.models.enas_trainer :members: :undoc-members: :show-inheritance: -fastNLP.models.enas_utils module --------------------------------- +fastNLP.models.enas\_utils module +--------------------------------- .. automodule:: fastNLP.models.enas_utils :members: :undoc-members: :show-inheritance: -fastNLP.models.sequence_modeling module ---------------------------------------- +fastNLP.models.sequence\_modeling module +---------------------------------------- .. automodule:: fastNLP.models.sequence_modeling :members: @@ -92,8 +97,8 @@ fastNLP.models.snli module :undoc-members: :show-inheritance: -fastNLP.models.star_transformer module --------------------------------------- +fastNLP.models.star\_transformer module +--------------------------------------- .. automodule:: fastNLP.models.star_transformer :members: @@ -101,10 +106,3 @@ fastNLP.models.star_transformer module :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.models - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.modules.aggregator.rst b/docs/source/fastNLP.modules.aggregator.rst index 478ac218..74ff5aed 100644 --- a/docs/source/fastNLP.modules.aggregator.rst +++ b/docs/source/fastNLP.modules.aggregator.rst @@ -1,54 +1,28 @@ fastNLP.modules.aggregator package ================================== -Submodules ----------- - -fastNLP.modules.aggregator.attention module -------------------------------------------- - -.. automodule:: fastNLP.modules.aggregator.attention +.. automodule:: fastNLP.modules.aggregator :members: :undoc-members: :show-inheritance: -fastNLP.modules.aggregator.avg_pool module ------------------------------------------- - -.. automodule:: fastNLP.modules.aggregator.avg_pool - :members: - :undoc-members: - :show-inheritance: +Submodules +---------- -fastNLP.modules.aggregator.kmax_pool module +fastNLP.modules.aggregator.attention module ------------------------------------------- -.. automodule:: fastNLP.modules.aggregator.kmax_pool - :members: - :undoc-members: - :show-inheritance: - -fastNLP.modules.aggregator.max_pool module ------------------------------------------- - -.. automodule:: fastNLP.modules.aggregator.max_pool +.. automodule:: fastNLP.modules.aggregator.attention :members: :undoc-members: :show-inheritance: -fastNLP.modules.aggregator.self_attention module ------------------------------------------------- +fastNLP.modules.aggregator.pooling module +----------------------------------------- -.. automodule:: fastNLP.modules.aggregator.self_attention +.. automodule:: fastNLP.modules.aggregator.pooling :members: :undoc-members: :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.modules.aggregator - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.modules.decoder.rst b/docs/source/fastNLP.modules.decoder.rst index 60706b06..5e467b98 100644 --- a/docs/source/fastNLP.modules.decoder.rst +++ b/docs/source/fastNLP.modules.decoder.rst @@ -1,6 +1,11 @@ fastNLP.modules.decoder package =============================== +.. automodule:: fastNLP.modules.decoder + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- @@ -29,10 +34,3 @@ fastNLP.modules.decoder.utils module :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.modules.decoder - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.rst b/docs/source/fastNLP.modules.encoder.rst index 4cc0b8ab..ff048be7 100644 --- a/docs/source/fastNLP.modules.encoder.rst +++ b/docs/source/fastNLP.modules.encoder.rst @@ -1,13 +1,26 @@ fastNLP.modules.encoder package =============================== +.. automodule:: fastNLP.modules.encoder + :members: + :undoc-members: + :show-inheritance: + Submodules ---------- -fastNLP.modules.encoder.char_embedding module ---------------------------------------------- +fastNLP.modules.encoder.bert module +----------------------------------- -.. automodule:: fastNLP.modules.encoder.char_embedding +.. automodule:: fastNLP.modules.encoder.bert + :members: + :undoc-members: + :show-inheritance: + +fastNLP.modules.encoder.char\_encoder module +-------------------------------------------- + +.. automodule:: fastNLP.modules.encoder.char_encoder :members: :undoc-members: :show-inheritance: @@ -20,8 +33,8 @@ fastNLP.modules.encoder.conv module :undoc-members: :show-inheritance: -fastNLP.modules.encoder.conv_maxpool module -------------------------------------------- +fastNLP.modules.encoder.conv\_maxpool module +-------------------------------------------- .. automodule:: fastNLP.modules.encoder.conv_maxpool :members: @@ -52,16 +65,16 @@ fastNLP.modules.encoder.lstm module :undoc-members: :show-inheritance: -fastNLP.modules.encoder.masked_rnn module ------------------------------------------ +fastNLP.modules.encoder.masked\_rnn module +------------------------------------------ .. automodule:: fastNLP.modules.encoder.masked_rnn :members: :undoc-members: :show-inheritance: -fastNLP.modules.encoder.star_transformer module ------------------------------------------------ +fastNLP.modules.encoder.star\_transformer module +------------------------------------------------ .. automodule:: fastNLP.modules.encoder.star_transformer :members: @@ -76,8 +89,8 @@ fastNLP.modules.encoder.transformer module :undoc-members: :show-inheritance: -fastNLP.modules.encoder.variational_rnn module ----------------------------------------------- +fastNLP.modules.encoder.variational\_rnn module +----------------------------------------------- .. automodule:: fastNLP.modules.encoder.variational_rnn :members: @@ -85,10 +98,3 @@ fastNLP.modules.encoder.variational_rnn module :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.modules.encoder - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.modules.rst b/docs/source/fastNLP.modules.rst index 53cc19a0..5884e655 100644 --- a/docs/source/fastNLP.modules.rst +++ b/docs/source/fastNLP.modules.rst @@ -1,6 +1,11 @@ fastNLP.modules package ======================= +.. automodule:: fastNLP.modules + :members: + :undoc-members: + :show-inheritance: + Subpackages ----------- @@ -21,8 +26,8 @@ fastNLP.modules.dropout module :undoc-members: :show-inheritance: -fastNLP.modules.other_modules module ------------------------------------- +fastNLP.modules.other\_modules module +------------------------------------- .. automodule:: fastNLP.modules.other_modules :members: @@ -38,10 +43,3 @@ fastNLP.modules.utils module :show-inheritance: -Module contents ---------------- - -.. automodule:: fastNLP.modules - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.rst b/docs/source/fastNLP.rst index 6348c9a6..f5247748 100644 --- a/docs/source/fastNLP.rst +++ b/docs/source/fastNLP.rst @@ -1,6 +1,11 @@ fastNLP package =============== +.. automodule:: fastNLP + :members: + :undoc-members: + :show-inheritance: + Subpackages ----------- @@ -8,15 +13,9 @@ Subpackages fastNLP.api fastNLP.automl + fastNLP.component fastNLP.core fastNLP.io fastNLP.models fastNLP.modules -Module contents ---------------- - -.. automodule:: fastNLP - :members: - :undoc-members: - :show-inheritance: