diff --git a/docs/requirements.txt b/docs/requirements.txt index 5b85f2ca..5720ca17 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ -sphinx==4.1.0 -pydata_sphinx_theme==0.6.3 -myst-parser==0.15.1 +sphinx==5.3.0 +pydata_sphinx_theme==0.11.0 +myst-parser==1.0.0 # TODO: #204 onnx diff --git a/docs/source/_templates/autosummary/class.rst b/docs/source/_templates/autosummary/class.rst new file mode 100644 index 00000000..688c1db1 --- /dev/null +++ b/docs/source/_templates/autosummary/class.rst @@ -0,0 +1,31 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :special-members: __init__, __call__ + :undoc-members: + :show-inheritance: + + {% block methods %} + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/source/_templates/autosummary/module.rst b/docs/source/_templates/autosummary/module.rst new file mode 100644 index 00000000..c2ae6d4d --- /dev/null +++ b/docs/source/_templates/autosummary/module.rst @@ -0,0 +1,68 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Module Attributes') }} + + .. autosummary:: + :toctree: . + + {% for item in attributes %} + {{ fullname }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: . + + {% for item in functions %} + {{ fullname }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: . + + {% for item in classes %} + {{ fullname }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: . + + {% for item in exceptions %} + {{ fullname }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + +{% block modules %} +{% if modules %} +.. rubric:: Modules + +.. autosummary:: + :toctree: . + :recursive: + {% for item in modules %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index fd906b89..a80154c4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,6 +45,8 @@ # Autosummary autosummary_generate = True +autosummary_imported_members = True +autoclass_content = "both" # -- Options for HTML output ------------------------------------------------- diff --git a/docs/source/reference/index.rst b/docs/source/reference/index.rst index c5509b25..d373eac2 100644 --- a/docs/source/reference/index.rst +++ b/docs/source/reference/index.rst @@ -1,10 +1,19 @@ -.. module:: pytorch_pfn_extras API Reference ============= * :ref:`genindex` +Package +------- +.. autosummary:: + :toctree: generated/ + :recursive: + + pytorch_pfn_extras + +.. currentmodule:: pytorch_pfn_extras + Training Loop ------------------ @@ -12,7 +21,6 @@ Trainer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autosummary:: - :toctree: generated/ engine.create_trainer engine.create_evaluator @@ -28,7 +36,6 @@ Extensions Manager ~~~~~~~~~~~~~~~~~~ .. autosummary:: - :toctree: generated/ training.ExtensionsManager training.IgniteExtensionsManager @@ -37,7 +44,6 @@ Extensions ~~~~~~~~~~ .. autosummary:: - :toctree: generated/ training.extension.make_extension training.extension.Extension @@ -45,7 +51,6 @@ Extensions .. autosummary:: - :toctree: generated/ training.extensions.BestValue training.extensions.Evaluator @@ -69,7 +74,6 @@ Triggers ~~~~~~~~ .. autosummary:: - :toctree: generated/ training.triggers.EarlyStoppingTrigger training.triggers.IntervalTrigger @@ -85,7 +89,6 @@ Reporting ~~~~~~~~~ .. autosummary:: - :toctree: generated/ reporting.Reporter reporting.report @@ -96,7 +99,6 @@ Logging ~~~~~~~ .. autosummary:: - :toctree: generated/ logging.get_logger @@ -104,7 +106,6 @@ Profiler ~~~~~~~~ .. autosummary:: - :toctree: generated/ profiler.TimeSummary.report @@ -112,7 +113,6 @@ Distributed Training --------------------- .. autosummary:: - :toctree: generated/ nn.parallel.DistributedDataParallel distributed.initialize_ompi_environment @@ -122,7 +122,6 @@ Check Pointing --------------------- .. autosummary:: - :toctree: generated/ utils.checkpoint @@ -131,7 +130,6 @@ Lazy Modules ------------------ .. autosummary:: - :toctree: generated/ nn.Ensure nn.ensure @@ -151,7 +149,6 @@ Export ~~~~~~~ .. autosummary:: - :toctree: generated/ onnx.export onnx.export_testcase @@ -161,7 +158,6 @@ Annotation ~~~~~~~~~~~ .. autosummary:: - :toctree: generated/ onnx.annotate onnx.apply_annotation @@ -174,7 +170,6 @@ Datasets ------------------------ .. autosummary:: - :toctree: generated/ dataset.SharedDataset dataset.TabularDataset @@ -185,12 +180,10 @@ Config ------------------------ .. autosummary:: - :toctree: generated/ config.Config .. autosummary:: - :toctree: generated/ config_types.optuna_types config_types.load_path_with_optuna_types @@ -200,7 +193,6 @@ NumPy/CuPy Compatibility ------------------------ .. autosummary:: - :toctree: generated/ from_ndarray as_ndarray @@ -209,7 +201,6 @@ NumPy/CuPy Compatibility from_numpy_dtype .. autosummary:: - :toctree: generated/ cuda.stream cuda.use_torch_mempool_in_cupy