Skip to content

Switch to sphinx_autodoc_typehints for doc #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.1
hooks:
- id: codespell
exclude: "(.cdb)"
Expand All @@ -22,7 +22,7 @@ repos:
# - id: pydocstyle
# additional_dependencies: [toml]
- repo: https://github.com/kynan/nbstripout
rev: 0.5.0
rev: 0.6.1
hooks:
- id: nbstripout
args: ["--extra-keys", "metadata.interpreter metadata.kernelspec metadata.language_info metadata.vscode"]
Expand Down
3 changes: 2 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ pdf:

# customized clean due to examples gallery
clean:
rm -rf build
rm -rf $(BUILDDIR)
find . -type d -name "_autosummary" -exec rm -rf {} +
6 changes: 6 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help
if "%1" == "clean" goto clean

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand All @@ -28,6 +29,11 @@ if errorlevel 9009 (
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:clean
rmdir /s /q %BUILDDIR% > /NUL 2>&1
for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d"
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

Expand Down
8 changes: 5 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.autodoc.typehints",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints",
"numpydoc",
"sphinx_copybutton",
"ansys_sphinx_theme",
]

autodoc_typehints = "description"

# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/dev", None),
Expand All @@ -61,6 +59,10 @@
# "pyvista": ("https://docs.pyvista.org/", None),
}

# sphinx_autodoc_typehints configuration
typehints_defaults = "comma"
simplify_optional_unions = False

# numpydoc configuration
numpydoc_show_class_members = False
numpydoc_xref_param_type = True
Expand Down
Loading