Browse Source

update the doc-tool to show __init__ and class doc separately

tags/v0.4.10
ChenXin 5 years ago
parent
commit
04737a105d
16 changed files with 14 additions and 17 deletions
  1. +4
    -3
      docs/count.py
  2. +4
    -2
      docs/source/conf.py
  3. +1
    -2
      docs/source/fastNLP.core.rst
  4. +1
    -0
      docs/source/fastNLP.embeddings.rst
  5. +1
    -0
      docs/source/fastNLP.io.rst
  6. +0
    -1
      docs/source/fastNLP.models.biaffine_parser.rst
  7. +0
    -1
      docs/source/fastNLP.models.cnn_text_classification.rst
  8. +1
    -1
      docs/source/fastNLP.models.rst
  9. +0
    -1
      docs/source/fastNLP.models.sequence_labeling.rst
  10. +0
    -1
      docs/source/fastNLP.models.snli.rst
  11. +0
    -1
      docs/source/fastNLP.models.star_transformer.rst
  12. +0
    -1
      docs/source/fastNLP.modules.decoder.rst
  13. +0
    -1
      docs/source/fastNLP.modules.encoder.rst
  14. +1
    -1
      docs/source/fastNLP.modules.rst
  15. +0
    -1
      docs/source/fastNLP.modules.utils.rst
  16. +1
    -0
      docs/source/fastNLP.rst

+ 4
- 3
docs/count.py View File

@@ -66,12 +66,13 @@ def create_rst_file(modules, name, children):
fout.write(t + "\n")
fout.write("\n")
fout.write(".. automodule:: " + name + "\n")
if len(m.__all__) > 0:
if name != "fastNLP.core" and len(m.__all__) > 0:
fout.write(" :members: " + ", ".join(m.__all__) + "\n")
fout.write(" :inherited-members:\n")
if not (name.startswith('fastNLP.models') or name.startswith('fastNLP.modules')):
fout.write(" :inherited-members:\n")
fout.write("\n")
if name in children:
fout.write("子模块\n------\n\n.. toctree::\n\n")
fout.write("子模块\n------\n\n.. toctree::\n :maxdepth: 1\n\n")
for module in children[name]:
fout.write(" " + module + "\n")



+ 4
- 2
docs/source/conf.py View File

@@ -168,10 +168,12 @@ texinfo_documents = [

# -- Extension configuration -------------------------------------------------
def maybe_skip_member(app, what, name, obj, skip, options):
if name.startswith("_"):
return True
if obj.__doc__ is None:
return True
if name == "__init__":
return False
if name.startswith("_"):
return True
return False




+ 1
- 2
docs/source/fastNLP.core.rst View File

@@ -2,13 +2,12 @@ fastNLP.core
============

.. automodule:: fastNLP.core
:members: DataSet, Instance, FieldArray, Padder, AutoPadder, EngChar2DPadder, Vocabulary, DataSetIter, BatchIter, TorchLoaderIter, Const, Tester, Trainer, cache_results, seq_len_to_mask, get_seq_len, logger, Callback, GradientClipCallback, EarlyStopCallback, FitlogCallback, EvaluateCallback, LRScheduler, ControlC, LRFinder, TensorboardCallback, WarmupCallback, SaveModelCallback, EchoCallback, TesterCallback, CallbackException, EarlyStopError, LossFunc, CrossEntropyLoss, L1Loss, BCELoss, NLLLoss, LossInForward, AccuracyMetric, SpanFPreRecMetric, ExtractiveQAMetric, Optimizer, SGD, Adam, AdamW, SequentialSampler, BucketSampler, RandomSampler, Sampler
:inherited-members:

子模块
------

.. toctree::
:maxdepth: 1

fastNLP.core.batch
fastNLP.core.callback


+ 1
- 0
docs/source/fastNLP.embeddings.rst View File

@@ -9,6 +9,7 @@ fastNLP.embeddings
------

.. toctree::
:maxdepth: 1

fastNLP.embeddings.bert_embedding
fastNLP.embeddings.char_embedding


+ 1
- 0
docs/source/fastNLP.io.rst View File

@@ -9,6 +9,7 @@ fastNLP.io
------

.. toctree::
:maxdepth: 1

fastNLP.io.data_bundle
fastNLP.io.embed_loader


+ 0
- 1
docs/source/fastNLP.models.biaffine_parser.rst View File

@@ -3,5 +3,4 @@ fastNLP.models.biaffine_parser

.. automodule:: fastNLP.models.biaffine_parser
:members: BiaffineParser, GraphParser
:inherited-members:


+ 0
- 1
docs/source/fastNLP.models.cnn_text_classification.rst View File

@@ -3,5 +3,4 @@ fastNLP.models.cnn_text_classification

.. automodule:: fastNLP.models.cnn_text_classification
:members: CNNText
:inherited-members:


+ 1
- 1
docs/source/fastNLP.models.rst View File

@@ -3,12 +3,12 @@ fastNLP.models

.. automodule:: fastNLP.models
:members: CNNText, SeqLabeling, AdvSeqLabel, ESIM, StarTransEnc, STSeqLabel, STNLICls, STSeqCls, BiaffineParser, GraphParser
:inherited-members:

子模块
------

.. toctree::
:maxdepth: 1

fastNLP.models.biaffine_parser
fastNLP.models.cnn_text_classification


+ 0
- 1
docs/source/fastNLP.models.sequence_labeling.rst View File

@@ -3,5 +3,4 @@ fastNLP.models.sequence_labeling

.. automodule:: fastNLP.models.sequence_labeling
:members: SeqLabeling, AdvSeqLabel
:inherited-members:


+ 0
- 1
docs/source/fastNLP.models.snli.rst View File

@@ -3,5 +3,4 @@ fastNLP.models.snli

.. automodule:: fastNLP.models.snli
:members: ESIM
:inherited-members:


+ 0
- 1
docs/source/fastNLP.models.star_transformer.rst View File

@@ -3,5 +3,4 @@ fastNLP.models.star_transformer

.. automodule:: fastNLP.models.star_transformer
:members: StarTransEnc, STNLICls, STSeqCls, STSeqLabel
:inherited-members:


+ 0
- 1
docs/source/fastNLP.modules.decoder.rst View File

@@ -3,5 +3,4 @@ fastNLP.modules.decoder

.. automodule:: fastNLP.modules.decoder
:members: MLP, ConditionalRandomField, viterbi_decode, allowed_transitions
:inherited-members:


+ 0
- 1
docs/source/fastNLP.modules.encoder.rst View File

@@ -3,5 +3,4 @@ fastNLP.modules.encoder

.. automodule:: fastNLP.modules.encoder
:members: ConvolutionCharEncoder, LSTMCharEncoder, ConvMaxpool, LSTM, StarTransformer, TransformerEncoder, VarRNN, VarLSTM, VarGRU, MaxPool, MaxPoolWithMask, AvgPool, AvgPoolWithMask, MultiHeadAttention
:inherited-members:


+ 1
- 1
docs/source/fastNLP.modules.rst View File

@@ -3,12 +3,12 @@ fastNLP.modules

.. automodule:: fastNLP.modules
:members: ConvolutionCharEncoder, LSTMCharEncoder, ConvMaxpool, LSTM, StarTransformer, TransformerEncoder, VarRNN, VarLSTM, VarGRU, MaxPool, MaxPoolWithMask, AvgPool, AvgPoolWithMask, MultiHeadAttention, MLP, ConditionalRandomField, viterbi_decode, allowed_transitions, TimestepDropout
:inherited-members:

子模块
------

.. toctree::
:maxdepth: 1

fastNLP.modules.decoder
fastNLP.modules.encoder


+ 0
- 1
docs/source/fastNLP.modules.utils.rst View File

@@ -3,5 +3,4 @@ fastNLP.modules.utils

.. automodule:: fastNLP.modules.utils
:members: initial_parameter, summary
:inherited-members:


+ 1
- 0
docs/source/fastNLP.rst View File

@@ -9,6 +9,7 @@ fastNLP
------

.. toctree::
:maxdepth: 1

fastNLP.core
fastNLP.embeddings


Loading…
Cancel
Save