From 997f11e538d901965d398e561f4c70b8d0725d3b Mon Sep 17 00:00:00 2001 From: Martin Walters <104021577+waltersma@users.noreply.github.com> Date: Fri, 21 Aug 2026 21:59:08 +0100 Subject: [PATCH 1/9] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d51379195..f064cb4fb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,9 +49,14 @@ repos: additional_dependencies: [toml] exclude: "tests/|examples/|__init__.py" +- repo: https://github.com/numpy/numpydoc + rev: v1.10.0 + hooks: + - id: numpydoc-validation + - repo: https://github.com/ansys/pre-commit-hooks rev: v0.2.8 hooks: - id: add-license-headers args: - - LICENSE \ No newline at end of file + - LICENSE From d1efbfed762bf7e9de5a0e2f1123440902b5f1b3 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 21 Aug 2026 21:00:36 +0000 Subject: [PATCH 2/9] chore: adding changelog file 1342.maintenance.md [dependabot-skip] --- doc/changelog.d/1342.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/1342.maintenance.md diff --git a/doc/changelog.d/1342.maintenance.md b/doc/changelog.d/1342.maintenance.md new file mode 100644 index 0000000000..e0fc2d1068 --- /dev/null +++ b/doc/changelog.d/1342.maintenance.md @@ -0,0 +1 @@ +Maint: enabling docstring checks From 3e0a9db534b6e2141a84c105b3c9b852adc5fe88 Mon Sep 17 00:00:00 2001 From: Martin Walters <104021577+waltersma@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:01:29 +0100 Subject: [PATCH 3/9] Update pyproject.toml --- pyproject.toml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 76d012f0df..e3fc5ddeee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -161,3 +161,29 @@ directory = "changed" name = "Changed" showcontent = true +[tool.numpydoc_validation] +# Keep in sync with doc/source/conf.py. +checks = [ + "GL06", + "GL07", + "GL08", + "GL09", + "GL10", + "SS01", + "SS04", + "PR01", + "RT01", + "RT02", +] +exclude = [ + '\\.ColorByType$', + '\\.DisplayMeshType$', + '\\.FaceConnectivity$', + '\\.ImportTypes$', + '\\.LabelToZoneMethod$', + '\\.Examples$', + 'ansys\\.meshing\\.prime\\.autogen\\.', + 'ansys\\.meshing\\.prime\\.internals\\.', + 'ansys\\.meshing\\.prime\\.relaxed_json\\.', +] + From fe8fa05a08a8818f25dde8a8596074ef00701a30 Mon Sep 17 00:00:00 2001 From: Martin Walters <104021577+waltersma@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:04:39 +0100 Subject: [PATCH 4/9] Update conf.py --- doc/source/conf.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index c4e67806e3..e420d30e13 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -131,10 +131,28 @@ # "SS03", # Summary does not end with a period "SS04", # Summary contains heading whitespaces # "SS05", # Summary must start with infinitive verb, not third person + "PR01", # Parameters in the signature must be documented + "RT01", # Functions that return a value need a Returns section "RT02", # The first line of the Returns section should contain only the # type, unless multiple values are being returned" } +# numpydoc validates Enum classes against Enum.__new__ (*values). Exclude hand-written +# enums here; autogen enums are covered by the autogen module pattern below. +numpydoc_validation_exclude = { + r"\.ColorByType$", + r"\.DisplayMeshType$", + r"\.FaceConnectivity$", + r"\.ImportTypes$", + r"\.LabelToZoneMethod$", + r"\.Examples$", + # Remove once autogen emits numpydoc-compliant parameter lines (`name : type`). + r"ansys\.meshing\.prime\.autogen\.", + # Remove once internals docstrings document all parameters and returns. + r"ansys\.meshing\.prime\.internals\.", + r"ansys\.meshing\.prime\.relaxed_json\.", +} + # static path html_static_path = ["_static"] From 6d1816f378255abf60b7751693f35bc729915da8 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 21 Aug 2026 21:05:41 +0000 Subject: [PATCH 5/9] chore: adding changelog file 1342.documentation.md [dependabot-skip] --- doc/changelog.d/{1342.maintenance.md => 1342.documentation.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/changelog.d/{1342.maintenance.md => 1342.documentation.md} (100%) diff --git a/doc/changelog.d/1342.maintenance.md b/doc/changelog.d/1342.documentation.md similarity index 100% rename from doc/changelog.d/1342.maintenance.md rename to doc/changelog.d/1342.documentation.md From 35f14570a2cecdf8d7f76572468f95d73b394271 Mon Sep 17 00:00:00 2001 From: Martin Walters <104021577+waltersma@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:13:22 +0100 Subject: [PATCH 6/9] Update pyproject.toml --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e3fc5ddeee..18e4aa30d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,4 +186,7 @@ exclude = [ 'ansys\\.meshing\\.prime\\.internals\\.', 'ansys\\.meshing\\.prime\\.relaxed_json\\.', ] - +exclude_files = [ + '^tests/.*', + '^examples/.*', +] From 46dfcd1623e357af80bf13d76d9a9c08330aac1f Mon Sep 17 00:00:00 2001 From: Martin Walters <104021577+waltersma@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:14:28 +0100 Subject: [PATCH 7/9] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f064cb4fb8..52cc9b2d65 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,6 +53,7 @@ repos: rev: v1.10.0 hooks: - id: numpydoc-validation + exclude: ^tests/|^examples/ - repo: https://github.com/ansys/pre-commit-hooks rev: v0.2.8 From ae75d32d22664a91daa61c61608b1098f5a3e3c9 Mon Sep 17 00:00:00 2001 From: Martin Walters <104021577+waltersma@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:15:48 +0100 Subject: [PATCH 8/9] Update conf.py --- doc/source/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index e420d30e13..6e6cd76cd4 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -139,6 +139,8 @@ # numpydoc validates Enum classes against Enum.__new__ (*values). Exclude hand-written # enums here; autogen enums are covered by the autogen module pattern below. +# Tests and examples are not public API (see pydocstyle excludes) and are skipped by +# the pre-commit hook via exclude_files in pyproject.toml. numpydoc_validation_exclude = { r"\.ColorByType$", r"\.DisplayMeshType$", From 6f2f6a8f0445e80c769034dbb93356c5876628a7 Mon Sep 17 00:00:00 2001 From: Martin Walters <104021577+waltersma@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:22:52 +0100 Subject: [PATCH 9/9] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 52cc9b2d65..5336d70740 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,7 +53,7 @@ repos: rev: v1.10.0 hooks: - id: numpydoc-validation - exclude: ^tests/|^examples/ + exclude: ^tests/|^examples/|^src/ansys/meshing/prime/(autogen|internals|relaxed_json)/ - repo: https://github.com/ansys/pre-commit-hooks rev: v0.2.8