diff --git a/.gitignore b/.gitignore index 4aa2051..2bc6487 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ coverage.xml # Sphinx documentation doc/_build/ doc/generated/ +doc/api/ # PyBuilder target/ diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index 8a76fae..f68bf63 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -14,6 +14,7 @@ dependencies: - pangeo-sphinx-book-theme - pytest - sphinx + - sphinxcontrib-apidoc - sphinx-autosummary-accessors - sphinx-copybutton - xarray diff --git a/doc/Makefile b/doc/Makefile index 00f3549..994bdcd 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -49,6 +49,7 @@ help: clean: rm -rf $(BUILDDIR)/* rm -rf generated/* + rm -rf api/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/doc/api.rst b/doc/api.rst deleted file mode 100644 index 168fde4..0000000 --- a/doc/api.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. _api: - -API reference -------------- - -This page provides an auto-generated summary of Xbatcher's API. - -Dataset.batch and DataArray.batch -================================= - -.. currentmodule:: xarray - -.. autosummary:: - :toctree: generated/ - :template: autosummary/accessor_method.rst - - Dataset.batch.generator - DataArray.batch.generator - -Core -==== - -.. autoclass:: xbatcher.BatchGenerator - :members: - -Dataloaders -=========== -.. autoclass:: xbatcher.loaders.torch.MapDataset - :members: - -.. autoclass:: xbatcher.loaders.torch.IterableDataset - :members: - -.. autoclass:: xbatcher.loaders.keras.CustomTFDataset - :members: diff --git a/doc/conf.py b/doc/conf.py index a86a59b..6561b35 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -52,6 +52,7 @@ "IPython.sphinxext.ipython_console_highlighting", "sphinx_autosummary_accessors", "sphinx_copybutton", + "sphinxcontrib.apidoc", ] # never execute notebooks: avoids lots of expensive imports on rtd @@ -83,6 +84,13 @@ def setup(app): numpydoc_class_members_toctree = False numpydoc_show_class_members = False +# API docs + +apidoc_module_dir = "../xbatcher" +apidoc_output_dir = "api" +apidoc_excluded_paths = [] +apidoc_separate_modules = True + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates", sphinx_autosummary_accessors.templates_path] diff --git a/doc/index.rst b/doc/index.rst index c65525a..72e8eeb 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -62,6 +62,6 @@ or via a built-in `Xarray accessor demo contributing