From 3199860ead95c7ca33ddf814ba2371f30d1af6d3 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Thu, 21 Nov 2024 11:21:26 -0600 Subject: [PATCH] add autoapi --- .gitignore | 3 ++- doc/source/api.rst | 14 -------------- doc/source/conf.py | 9 ++++++++- doc/source/index.rst | 4 ++-- pyproject.toml | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) delete mode 100644 doc/source/api.rst diff --git a/.gitignore b/.gitignore index 42fd952..7c7d827 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ test-output.xml .venv /env +.env .DS_Store doc/_build/*/* - +doc/source/api/* diff --git a/doc/source/api.rst b/doc/source/api.rst deleted file mode 100644 index 819a7c9..0000000 --- a/doc/source/api.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _ref_api: - -API -=== - -.. currentmodule:: ansys.tools.path - -.. autosummary:: - :toctree: _autosummary - - find_ansys - get_available_ansys_installations - change_default_ansys_path - save_ansys_path diff --git a/doc/source/conf.py b/doc/source/conf.py index e11bc14..90e14fa 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -40,10 +40,15 @@ "additional_breadcrumbs": [ ("PyAnsys", "https://docs.pyansys.com/"), ], + "ansys_sphinx_theme_autoapi": { + "project": project, + "directory": "src/ansys", + }, } # Sphinx extensions extensions = [ + "ansys_sphinx_theme.extension.autoapi", "sphinx.ext.autodoc", "sphinx.ext.autosummary", "numpydoc", @@ -63,6 +68,8 @@ # "grpc": ("https://grpc.github.io/grpc/python/", None), } +suppress_warnings = ["label.*", "autoapi.python_import_resolution", "design.grid", "config.cache"] + # numpydoc configuration numpydoc_show_class_members = False numpydoc_xref_param_type = True @@ -73,7 +80,7 @@ numpydoc_validation_checks = { "GL06", # Found unknown section "GL07", # Sections are in the wrong order. - "GL08", # The object does not have a docstring + # "GL08", # The object does not have a docstring "GL09", # Deprecation warning should precede extended summary "GL10", # reST directives {directives} must be followed by two colons "SS01", # No summary found diff --git a/doc/source/index.rst b/doc/source/index.rst index 4c3baca..9f6d952 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -8,7 +8,7 @@ :hidden: :maxdepth: 3 - api + api/index contribute @@ -27,7 +27,7 @@ How to install How to use ---------- -You can use any of the functions available in the :ref:`ref_api` +You can use any of the functions available in the to identify the path of the local Ansys installation. For example you can use :func:`find_ansys ` diff --git a/pyproject.toml b/pyproject.toml index 000d6e5..724233d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tests = ["pytest==8.3.3", "pytest-cov==6.0.0", "pyfakefs==5.7.1"] doc = [ "Sphinx==8.1.3", - "ansys-sphinx-theme==1.2.1", + "ansys-sphinx-theme[autoapi]==1.2.1", "numpydoc==1.8.0", "sphinx-copybutton==0.5.2", ]