From b360efd7823eaa2a7275cd25e2b97e25a5d0ed76 Mon Sep 17 00:00:00 2001 From: afernand Date: Mon, 16 Jun 2025 16:20:14 +0200 Subject: [PATCH 01/28] maint: Migrate autoAPI to ansys-sphinx-theme autoAPI --- .gitignore | 1 + doc/source/api/index.rst | 14 -------------- doc/source/conf.py | 19 +++++++++++++++---- 3 files changed, 16 insertions(+), 18 deletions(-) delete mode 100644 doc/source/api/index.rst diff --git a/.gitignore b/.gitignore index f7d7ebe318..a1b77bdb74 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ dist/ _autosummary _build/ _gallery_backreferences +doc/source/api # Testing .coverage diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst deleted file mode 100644 index 708ca74655..0000000000 --- a/doc/source/api/index.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _ref_index_api: - -============= -API reference -============= - -This section gives an overview of all API classes, methods, and parameters present in PyPrimeMesh. - -.. autosummary:: - :toctree: _autosummary - - ansys.meshing.prime - ansys.meshing.prime.examples - ansys.meshing.prime.lucid diff --git a/doc/source/conf.py b/doc/source/conf.py index 0ef0e741be..9a9fc162e8 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -63,16 +63,18 @@ "title": "PyPrimeMesh cheat sheet", "version": __version__, }, + "ansys_sphinx_theme_autoapi": { + "project": project, + }, } # Sphinx extensions extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', - "numpydoc", "sphinx.ext.intersphinx", "sphinx_copybutton", - "sphinx_gallery.gen_gallery", + # "sphinx_gallery.gen_gallery", "jupyter_sphinx", "notfound.extension", "sphinx.ext.coverage", @@ -83,8 +85,19 @@ "sphinxemoji.sphinxemoji", "sphinx_design", "pyvista.ext.viewer_directive", + "ansys_sphinx_theme.extension.autoapi", ] nbsphinx_execute = "always" +suppress_warnings = [ + "docutils", + "ref.class", + "ref.obj", + "ref.func", + "toc.not_included", + "toc.not_readable", + "autoapi.python_import_resolution", + "toc.not_included", +] # Intersphinx mapping intersphinx_mapping = { @@ -177,5 +190,3 @@ "ignore_pattern": "flycheck*", "thumbnail_size": (350, 350), } - -supress_warnings = ["docutils"] From a708935a2c70f7ce1b1f988fe0cac8a11ffa4251 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:24:45 +0000 Subject: [PATCH 02/28] chore: adding changelog file 1061.documentation.md [dependabot-skip] --- doc/changelog.d/1061.documentation.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/1061.documentation.md diff --git a/doc/changelog.d/1061.documentation.md b/doc/changelog.d/1061.documentation.md new file mode 100644 index 0000000000..3ae5a42563 --- /dev/null +++ b/doc/changelog.d/1061.documentation.md @@ -0,0 +1 @@ +maint: Migrate autoAPI to ansys-sphinx-theme autoAPI \ No newline at end of file From 7c3ec26eed6c1576cf481e0a7b379254a4baf376 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:46:11 +0000 Subject: [PATCH 03/28] chore: adding changelog file 1061.miscellaneous.md [dependabot-skip] --- doc/changelog.d/1061.documentation.md | 1 - doc/changelog.d/1061.miscellaneous.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 doc/changelog.d/1061.documentation.md create mode 100644 doc/changelog.d/1061.miscellaneous.md diff --git a/doc/changelog.d/1061.documentation.md b/doc/changelog.d/1061.documentation.md deleted file mode 100644 index 3ae5a42563..0000000000 --- a/doc/changelog.d/1061.documentation.md +++ /dev/null @@ -1 +0,0 @@ -maint: Migrate autoAPI to ansys-sphinx-theme autoAPI \ No newline at end of file diff --git a/doc/changelog.d/1061.miscellaneous.md b/doc/changelog.d/1061.miscellaneous.md new file mode 100644 index 0000000000..4a8dbdd937 --- /dev/null +++ b/doc/changelog.d/1061.miscellaneous.md @@ -0,0 +1 @@ +Maint: migrate autoapi to ansys-sphinx-theme autoapi \ No newline at end of file From 21ff89047525d8a7cddb0701009fa069ba94c309 Mon Sep 17 00:00:00 2001 From: afernand Date: Tue, 24 Jun 2025 15:27:34 +0200 Subject: [PATCH 04/28] fix: Add missing init files --- doc/source/conf.py | 11 +++++---- src/ansys/meshing/prime/autogen/__init__.py | 1 + src/ansys/meshing/prime/core/__init__.py | 23 +++++++++++++++++++ src/ansys/meshing/prime/internals/__init__.py | 23 +++++++++++++++++++ src/ansys/meshing/prime/params/__init__.py | 23 +++++++++++++++++++ 5 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 src/ansys/meshing/prime/autogen/__init__.py create mode 100644 src/ansys/meshing/prime/core/__init__.py create mode 100644 src/ansys/meshing/prime/internals/__init__.py create mode 100644 src/ansys/meshing/prime/params/__init__.py diff --git a/doc/source/conf.py b/doc/source/conf.py index 9a9fc162e8..6854fbc325 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -58,13 +58,14 @@ "icon": "fa fa-comment fa-fw", }, ], - "cheatsheet": { - "file": "cheatsheet/cheat_sheet.qmd", - "title": "PyPrimeMesh cheat sheet", - "version": __version__, - }, + # "cheatsheet": { + # "file": "cheatsheet/cheat_sheet.qmd", + # "title": "PyPrimeMesh cheat sheet", + # "version": __version__, + # }, "ansys_sphinx_theme_autoapi": { "project": project, + "add_toctree_entry": True, }, } diff --git a/src/ansys/meshing/prime/autogen/__init__.py b/src/ansys/meshing/prime/autogen/__init__.py new file mode 100644 index 0000000000..2ee004e455 --- /dev/null +++ b/src/ansys/meshing/prime/autogen/__init__.py @@ -0,0 +1 @@ +"""Autogenerated module."""" \ No newline at end of file diff --git a/src/ansys/meshing/prime/core/__init__.py b/src/ansys/meshing/prime/core/__init__.py new file mode 100644 index 0000000000..3a1406bf22 --- /dev/null +++ b/src/ansys/meshing/prime/core/__init__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +"""Core module.""" diff --git a/src/ansys/meshing/prime/internals/__init__.py b/src/ansys/meshing/prime/internals/__init__.py new file mode 100644 index 0000000000..cddab16ada --- /dev/null +++ b/src/ansys/meshing/prime/internals/__init__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +"""Internal module.""" diff --git a/src/ansys/meshing/prime/params/__init__.py b/src/ansys/meshing/prime/params/__init__.py new file mode 100644 index 0000000000..3fda893201 --- /dev/null +++ b/src/ansys/meshing/prime/params/__init__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +"""Params module.""" From 8448ee959622ae94d7e78f5124167cfda3107b89 Mon Sep 17 00:00:00 2001 From: afernand Date: Tue, 24 Jun 2025 15:28:41 +0200 Subject: [PATCH 05/28] fix: Revert examples --- doc/source/conf.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 6854fbc325..7834466888 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -58,14 +58,13 @@ "icon": "fa fa-comment fa-fw", }, ], - # "cheatsheet": { - # "file": "cheatsheet/cheat_sheet.qmd", - # "title": "PyPrimeMesh cheat sheet", - # "version": __version__, - # }, + "cheatsheet": { + "file": "cheatsheet/cheat_sheet.qmd", + "title": "PyPrimeMesh cheat sheet", + "version": __version__, + }, "ansys_sphinx_theme_autoapi": { "project": project, - "add_toctree_entry": True, }, } @@ -75,7 +74,7 @@ 'sphinx.ext.autosummary', "sphinx.ext.intersphinx", "sphinx_copybutton", - # "sphinx_gallery.gen_gallery", + "sphinx_gallery.gen_gallery", "jupyter_sphinx", "notfound.extension", "sphinx.ext.coverage", From cc8d394444511ecdc4279fedd5009b63bc9813e0 Mon Sep 17 00:00:00 2001 From: afernand Date: Thu, 26 Jun 2025 12:01:33 +0200 Subject: [PATCH 06/28] fix: Typo --- src/ansys/meshing/prime/autogen/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/meshing/prime/autogen/__init__.py b/src/ansys/meshing/prime/autogen/__init__.py index 2ee004e455..96fd1a0d28 100644 --- a/src/ansys/meshing/prime/autogen/__init__.py +++ b/src/ansys/meshing/prime/autogen/__init__.py @@ -1 +1 @@ -"""Autogenerated module."""" \ No newline at end of file +"""Autogenerated module.""" \ No newline at end of file From 37bd8ba20a8657825c6c87c99cd503af96d70c8f Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 27 Jun 2025 09:52:00 +0200 Subject: [PATCH 07/28] fix: add package depth for 3 spacing --- doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 7834466888..b178b07630 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -65,6 +65,7 @@ }, "ansys_sphinx_theme_autoapi": { "project": project, + "package_depth": 4, }, } From 4094b9282af3f4badf87e691d4a231084e02e9d8 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 27 Jun 2025 11:02:27 +0200 Subject: [PATCH 08/28] fix: typo in makefile --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 5f9d1a9451..67dc7deba0 100755 --- a/doc/Makefile +++ b/doc/Makefile @@ -21,7 +21,7 @@ help: # customized clean due to examples gallery clean: - rm -rf build + rm -rf _build find . -type d -name "_autosummary" -exec rm -rf {} + # Create PDF From b7e4f5f3cd49540b4c056dd764500211531fc1cc Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 27 Jun 2025 16:28:12 +0200 Subject: [PATCH 09/28] docs(autoapi): ignore patterns --- doc/source/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index b178b07630..423b05c5c7 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -66,6 +66,11 @@ "ansys_sphinx_theme_autoapi": { "project": project, "package_depth": 4, + "ignore": [ + # ignore all files under the ``writer`` subpackage. + "*relaxed_json*", + "*internals*", + ], }, } From 481e18249d445807892367dd1d9a087b012b9179 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 27 Jun 2025 16:28:54 +0200 Subject: [PATCH 10/28] docs(autoapi): add inline comment --- doc/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 423b05c5c7..eb6c4e86e6 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -67,7 +67,8 @@ "project": project, "package_depth": 4, "ignore": [ - # ignore all files under the ``writer`` subpackage. + # ignore all files under the ``relaxed json`` and + # ``internals`` subpackage. "*relaxed_json*", "*internals*", ], From cf38897648c9a7569bbe7178b5fb221fa27b39d3 Mon Sep 17 00:00:00 2001 From: afernand Date: Mon, 30 Jun 2025 09:46:19 +0200 Subject: [PATCH 11/28] fix: pre-commit --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index eb6c4e86e6..0b0c91f4b3 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -67,7 +67,7 @@ "project": project, "package_depth": 4, "ignore": [ - # ignore all files under the ``relaxed json`` and + # ignore all files under the ``relaxed json`` and # ``internals`` subpackage. "*relaxed_json*", "*internals*", From 0b6421159f7b4b4fbb7c64ddef353a432f908569 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Mon, 30 Jun 2025 12:20:39 +0200 Subject: [PATCH 12/28] fix(code): add all methods --- src/ansys/meshing/prime/__init__.py | 395 +++++++++++++++++++++++++++- tests/test_imports.py | 9 + 2 files changed, 403 insertions(+), 1 deletion(-) create mode 100644 tests/test_imports.py diff --git a/src/ansys/meshing/prime/__init__.py b/src/ansys/meshing/prime/__init__.py index 57e9477fa5..67861e7d2b 100644 --- a/src/ansys/meshing/prime/__init__.py +++ b/src/ansys/meshing/prime/__init__.py @@ -1,3 +1,25 @@ +# Copyright (C) 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + '''PyPrimeMesh Client library ''' # isort: skip_file @@ -146,5 +168,376 @@ def __filter_internal_symbols(symbol): __symbols = (s for s in dir() if not s.startswith('_')) __symbols = filter(__filter_internal_symbols, __symbols) -__all__ = list(__symbols) +__all__ = [ + 'AddLabelResults', + 'AddThicknessParams', + 'AddThicknessResults', + 'AddToZoneResults', + 'AdvancedSurferSetup', + 'AutoMesh', + 'AutoMeshParams', + 'AutoMeshResults', + 'AutoNodeMoveParams', + 'AutoQuadMesher', + 'AutoQuadMesherResults', + 'BCPair', + 'BCPairType', + 'BCsVolumetricModality', + 'BOIType', + 'BodyQueryType', + 'BoiSizingParams', + 'BoundaryFittedSpline', + 'BoundaryFittedSplineParams', + 'BoundingBox', + 'CadFaceter', + 'CadReaderRoute', + 'CadRefacetingMaxEdgeSizeLimit', + 'CadRefacetingParams', + 'CadRefacetingResolution', + 'CdbAnalysisType', + 'CdbSimulationType', + 'CellQualityMeasure', + 'CellStatisticsParams', + 'CellStatisticsResults', + 'CellZoneletType', + 'CheckFaceDeviationParams', + 'CheckFaceDeviationResults', + 'CheckMeshParams', + 'CheckMeshResults', + 'CheckTopologyParams', + 'Client', + 'CollapseParams', + 'CollapseResults', + 'CollapseTool', + 'ComponentChildrenParams', + 'ComponentChildrenResults', + 'ComputeTopoVolumesResults', + 'ComputeVolumesParams', + 'ComputeVolumesResults', + 'Connect', + 'ConnectFacesParams', + 'ConnectResults', + 'ContactElementTypeParams', + 'ContactPatchAxis', + 'ContactPreventionParams', + 'ControlData', + 'ControlPointSelection', + 'CopyZoneletsParams', + 'CopyZoneletsResults', + 'CreateBOIParams', + 'CreateBOIResults', + 'CreateCapParams', + 'CreateCapResults', + 'CreateContactPatchParams', + 'CreateContactPatchResults', + 'CreateIntersectionEdgeLoopsParams', + 'CreateIntersectionEdgeLoopsResults', + 'CreateMaterialPointParams', + 'CreateMaterialPointResults', + 'CreateShellBLResults', + 'CreateVolumeZonesType', + 'CreateZoneResults', + 'CurvatureSizingParams', + 'DeadRegion', + 'DefeatureTopologyParams', + 'DeleteFringesAndOverlapsParams', + 'DeleteFringesAndOverlapsResults', + 'DeleteInteriorNodesParams', + 'DeleteMaterialPointResults', + 'DeleteMeshParams', + 'DeleteMeshResults', + 'DeleteResults', + 'DeleteTool', + 'DeleteTopoEntitiesParams', + 'DeleteTopoEntitiesResults', + 'DeleteUnwettedParams', + 'DeleteUnwettedResult', + 'DeleteVolumesParams', + 'DeleteVolumesResults', + 'DeleteZoneResults', + 'DetectAndTreatCircularFacesParams', + 'DetectAndTreatFeaturesParams', + 'DetectAndTreatHolesParams', + 'DetectCircularHolesParams', + 'DetectHolesParams', + 'DetectNonCircularHolesParams', + 'EdgeConnectType', + 'EdgeConnectivityResults', + 'EdgeMergeControl', + 'ErrorCode', + 'ExportBoundaryFittedSplineParams', + 'ExportFluentCaseParams', + 'ExportFluentMeshingMeshParams', + 'ExportLSDynaIGAResults', + 'ExportLSDynaIgaKeywordFileParams', + 'ExportLSDynaKeywordFileParams', + 'ExportLSDynaResults', + 'ExportMapdlCdbParams', + 'ExportMapdlCdbResults', + 'ExportSTLParams', + 'ExtractFeatureParams', + 'ExtractFeatureResults', + 'ExtractTopoVolumesParams', + 'ExtractTopoVolumesResults', + 'ExtractVolumesParams', + 'ExtractVolumesResults', + 'ExtractedFeatureIds', + 'FaceAndEdgeConnectivityParams', + 'FaceAndEdgeConnectivityResults', + 'FaceConnectivityResults', + 'FaceQualityMeasure', + 'FeatureExtraction', + 'FeatureRecoveryParams', + 'FileIO', + 'FileReadParams', + 'FileReadResults', + 'FileWriteParams', + 'FileWriteResults', + 'FillHolesAtPlaneParams', + 'FillHolesAtPlaneResults', + 'FixInvalidNormalNodeParams', + 'FixInvalidNormalNodeResults', + 'FlowDirection', + 'FuseOption', + 'FuseParams', + 'FuseResults', + 'GlobalSizingParams', + 'HardSizingParams', + 'HexCoreCellElementType', + 'HexCoreParams', + 'HexCoreTransitionLayerType', + 'HexToSpline', + 'HexToSplineParams', + 'IGAResults', + 'IGASpline', + 'IGAUnstructuredSplineSolid', + 'IGAUnstructuredSplineSurf', + 'ImportAbaqusParams', + 'ImportAbaqusResults', + 'ImportCadParams', + 'ImportCadResults', + 'ImportFluentCaseParams', + 'ImportFluentCaseResults', + 'ImportFluentMeshingMeshParams', + 'ImportFluentMeshingMeshResults', + 'ImportMapdlCdbParams', + 'ImportMapdlCdbResults', + 'IntersectParams', + 'IntersectionMask', + 'Iterable', + 'JoinParams', + 'JoinSeparateMethod', + 'LSDynaAnalysisType', + 'LSDynaFileFormatType', + 'LabelExportParams', + 'LeakPreventionParams', + 'LengthUnit', + 'LocalSurferParams', + 'LocalSurferResults', + 'MatchMorphParams', + 'MatchMorphResults', + 'MatchPair', + 'MatchPairTargetType', + 'MaterialPointManager', + 'MaterialPointType', + 'MergeBoundaryNodesParams', + 'MergeBoundaryNodesResults', + 'MergeNodeType', + 'MergePartsParams', + 'MergePartsResults', + 'MergeVolumesParams', + 'MergeVolumesResults', + 'MergeZoneletsParams', + 'MergeZoneletsResults', + 'MeshInfo', + 'MeshStackerParams', + 'MeshStackerResults', + 'MeshedSizingParams', + 'Model', + 'MorphBCParams', + 'MorphSolveParams', + 'Morpher', + 'MultiZoneControl', + 'MultiZoneEdgeBiasingParams', + 'MultiZoneMapMeshParams', + 'MultiZoneSizingParams', + 'MultiZoneSweepMeshParams', + 'NamePatternParams', + 'OptimizeQuadMeshParams', + 'OverlapPairs', + 'OverlapSearchResults', + 'Part', + 'PartCreationType', + 'PartSummaryParams', + 'PartSummaryResults', + 'PartZonelets', + 'PartialDefeatureParams', + 'PeriodicControl', + 'PeriodicControlParams', + 'PeriodicControlSummaryParams', + 'PeriodicControlSummaryResult', + 'PrimeRuntimeError', + 'PrimeRuntimeWarning', + 'PrismControl', + 'PrismControlGrowthParams', + 'PrismControlOffsetType', + 'PrismParams', + 'PrismStairStep', + 'ProjectOnGeometryParams', + 'ProjectOnGeometryResults', + 'ProximitySizingParams', + 'QuadToSpline', + 'QuadToSplineParams', + 'ReadSizeFieldParams', + 'RefineAtContactsParams', + 'RefineAtContactsResults', + 'RefineSplineParams', + 'RefineTetMeshParams', + 'RemoveLabelResults', + 'RemoveZoneResults', + 'RepairEdgesParams', + 'RepairTopologyParams', + 'ResolveIntersectionResult', + 'ResolveIntersectionsParams', + 'SFPeriodicParams', + 'Scaffolder', + 'ScaffolderMergeResults', + 'ScaffolderParams', + 'ScaffolderRepairMode', + 'ScaffolderResults', + 'ScaffolderSplitResults', + 'ScopeDefinition', + 'ScopeEntity', + 'ScopeEvaluationType', + 'ScopeExpressionType', + 'ScopeZoneletParams', + 'SearchByFoldsParams', + 'SearchByFoldsResults', + 'SearchByIntersectionResults', + 'SearchByInvalidNormalsResults', + 'SearchByQualityParams', + 'SearchByQualityResults', + 'SearchBySelfIntersectionParams', + 'SearchBySpikeParams', + 'SearchBySpikeResults', + 'SearchByThinStripParams', + 'SearchByThinStripResults', + 'SearchInfoByRegisterIdParams', + 'SearchInfoByRegisterIdResults', + 'SeparateBlocksFormatType', + 'SetContactPreventionsResults', + 'SetFeatureRecoveriesResults', + 'SetLeakPreventionsResults', + 'SetNameResults', + 'SetParamsResults', + 'SetScopeResults', + 'SetSizingResults', + 'ShellBLControl', + 'ShellBLControlGrowthParams', + 'ShellBLOffsetType', + 'ShellBLParams', + 'SizeControl', + 'SizeControlSummaryParams', + 'SizeControlSummaryResult', + 'SizeField', + 'SizeFieldFileReadResults', + 'SizeFieldType', + 'SizingType', + 'SmoothDihedralFaceNodesParams', + 'SmoothDihedralFaceNodesResults', + 'SmoothType', + 'SoftSizingParams', + 'SoiSizingParams', + 'SolverType', + 'SplineContinuityType', + 'SplineFeatureCaptureType', + 'SplineRefinementType', + 'SplitParams', + 'StitchParams', + 'StitchType', + 'StretchFreeBoundariesParams', + 'StretchFreeBoundariesResults', + 'SubtractVolumesParams', + 'SubtractVolumesResults', + 'SubtractZoneletsParams', + 'SubtractZoneletsResults', + 'SurfaceDiagnosticSummaryParams', + 'SurfaceDiagnosticSummaryResults', + 'SurfaceFeatureType', + 'SurfaceMeshSizeScaling', + 'SurfaceQualityResult', + 'SurfaceQualitySummaryParams', + 'SurfaceQualitySummaryResults', + 'SurfaceSearch', + 'SurfaceUtilities', + 'Surfer', + 'SurferParams', + 'SurferResults', + 'SweepType', + 'TetMeshSplineParams', + 'TetParams', + 'ThinStripType', + 'ThinVolumeControl', + 'ThinVolumeMeshParams', + 'TopoData', + 'TopoFillHoleParams', + 'TopoFillHoleResult', + 'TopoSearchField', + 'TopoUtilities', + 'Transform', + 'TransformParams', + 'TransformResults', + 'TriangulateParams', + 'TriangulateResults', + 'TrimmedSolidSplineCutMode', + 'TrimmedSpline', + 'TrimmedSplineResults', + 'UniformSolidSplineCreationParams', + 'Union', + 'VTComposer', + 'VTComposerParams', + 'VTComposerResults', + 'VolumeControl', + 'VolumeControlParams', + 'VolumeFillType', + 'VolumeMeshTool', + 'VolumeMeshToolResults', + 'VolumeNamingType', + 'VolumeQualityResultsPart', + 'VolumeQualitySummaryParams', + 'VolumeQualitySummaryResults', + 'VolumeSearch', + 'VolumeSweeper', + 'VolumetricScaffolderParams', + 'VolumetricSizeFieldComputeParams', + 'VolumetricSizeFieldComputeResults', + 'WarningCode', + 'WrapParams', + 'WrapRegion', + 'WrapResult', + 'Wrapper', + 'WrapperCloseGapsParams', + 'WrapperCloseGapsResult', + 'WrapperControl', + 'WrapperImproveQualityParams', + 'WrapperImproveResult', + 'WrapperPatchFlowRegionsParams', + 'WrapperPatchFlowRegionsResult', + 'WriteSizeFieldParams', + 'ZoneMeshResult', + 'ZoneType', + 'disable_optimizing_numpy_arrays', + 'enable_log_output', + 'enable_optimizing_numpy_arrays', + 'examples', + 'is_optimizing_numpy_arrays', + 'launch_prime', + 'launch_server_process', + 'local_model', + 'lucid', + 'np', + 'numpy_array_optimization_disabled', + 'numpy_array_optimization_enabled', + 'relaxed_json', +] # print(__all__) diff --git a/tests/test_imports.py b/tests/test_imports.py new file mode 100644 index 0000000000..fad77668a3 --- /dev/null +++ b/tests/test_imports.py @@ -0,0 +1,9 @@ +from ansys.meshing.prime import __symbols, __all__ + +def test_imports(): + """Test that all symbols in __all__ are imported from __symbols__.""" + symbols = list(__symbols.keys()) + for symbol in __all__: + assert symbol in symbols, f"{symbol} is not in __symbols__" + + \ No newline at end of file From 429c0eb4878a92c56a3bd098beb343fec63d5eb9 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:22:33 +0000 Subject: [PATCH 13/28] chore: adding changelog file 1061.maintenance.md [dependabot-skip] --- doc/changelog.d/{1061.miscellaneous.md => 1061.maintenance.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/changelog.d/{1061.miscellaneous.md => 1061.maintenance.md} (100%) diff --git a/doc/changelog.d/1061.miscellaneous.md b/doc/changelog.d/1061.maintenance.md similarity index 100% rename from doc/changelog.d/1061.miscellaneous.md rename to doc/changelog.d/1061.maintenance.md From 33edc892e33f7207d502b699ac8fef9775d8f9da Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Mon, 30 Jun 2025 15:20:36 +0200 Subject: [PATCH 14/28] fix: update the docs --- doc/source/_templates/autoapi/index.rst | 14 ++++++++++++++ doc/source/conf.py | 8 +++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 doc/source/_templates/autoapi/index.rst diff --git a/doc/source/_templates/autoapi/index.rst b/doc/source/_templates/autoapi/index.rst new file mode 100644 index 0000000000..3f2a88ebe3 --- /dev/null +++ b/doc/source/_templates/autoapi/index.rst @@ -0,0 +1,14 @@ +API reference +============= + +This section describes ansys-meshing-prime endpoints, their capabilities, and how +to interact with them programmatically. + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + ansys.meshing.prime + ansys.meshing.prime.lucid + ansys.meshing.prime.examples + ansys.meshing.prime.graphics diff --git a/doc/source/conf.py b/doc/source/conf.py index 0b0c91f4b3..db93b8d73d 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -64,14 +64,16 @@ "version": __version__, }, "ansys_sphinx_theme_autoapi": { - "project": project, - "package_depth": 4, + "templates": "_templates/autoapi", "ignore": [ - # ignore all files under the ``relaxed json`` and + # ignore all files under the ``relaxed json`` and # ``internals`` subpackage. "*relaxed_json*", "*internals*", ], + "options":[ + 'members', 'undoc-members', 'private-members', 'show-inheritance', 'show-module-summary', 'special-members', 'imported-members', + ] }, } From 5996dd2463e751349a6c97c5a5b4f672cc41c491 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Mon, 30 Jun 2025 15:22:00 +0200 Subject: [PATCH 15/28] fix: precommit --- doc/source/conf.py | 14 ++++++++++---- tests/test_imports.py | 27 ++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index db93b8d73d..ceb5566e88 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -66,14 +66,20 @@ "ansys_sphinx_theme_autoapi": { "templates": "_templates/autoapi", "ignore": [ - # ignore all files under the ``relaxed json`` and + # ignore all files under the ``relaxed json`` and # ``internals`` subpackage. "*relaxed_json*", "*internals*", ], - "options":[ - 'members', 'undoc-members', 'private-members', 'show-inheritance', 'show-module-summary', 'special-members', 'imported-members', - ] + "options": [ + 'members', + 'undoc-members', + 'private-members', + 'show-inheritance', + 'show-module-summary', + 'special-members', + 'imported-members', + ], }, } diff --git a/tests/test_imports.py b/tests/test_imports.py index fad77668a3..7dbc867b1d 100644 --- a/tests/test_imports.py +++ b/tests/test_imports.py @@ -1,9 +1,30 @@ -from ansys.meshing.prime import __symbols, __all__ +# Copyright (C) 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from ansys.meshing.prime import __all__, __symbols + def test_imports(): """Test that all symbols in __all__ are imported from __symbols__.""" symbols = list(__symbols.keys()) for symbol in __all__: assert symbol in symbols, f"{symbol} is not in __symbols__" - - \ No newline at end of file From 32da2d674d44a398265eafbaa95102b2c79c7b66 Mon Sep 17 00:00:00 2001 From: afernand Date: Tue, 1 Jul 2025 09:09:15 +0200 Subject: [PATCH 16/28] fix: Test --- tests/test_imports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_imports.py b/tests/test_imports.py index 7dbc867b1d..880448579d 100644 --- a/tests/test_imports.py +++ b/tests/test_imports.py @@ -20,11 +20,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from ansys.meshing.prime import __all__, __symbols +from ansys.meshing.prime import __all__ +import ansys.meshing.prime def test_imports(): """Test that all symbols in __all__ are imported from __symbols__.""" - symbols = list(__symbols.keys()) + symbols = dir(ansys.meshing.prime) for symbol in __all__: assert symbol in symbols, f"{symbol} is not in __symbols__" From 6d91292e56ebb2a5ed3a7d84b3d3ee3b11655ba6 Mon Sep 17 00:00:00 2001 From: afernand Date: Tue, 1 Jul 2025 09:19:26 +0200 Subject: [PATCH 17/28] fix: Import --- tests/test_imports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_imports.py b/tests/test_imports.py index 880448579d..b47c669faf 100644 --- a/tests/test_imports.py +++ b/tests/test_imports.py @@ -20,8 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from ansys.meshing.prime import __all__ import ansys.meshing.prime +from ansys.meshing.prime import __all__ def test_imports(): From 3e92ce6fb90a00f1510ee1b89849805cf74fa2e1 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 1 Jul 2025 16:39:21 +0200 Subject: [PATCH 18/28] fix(template): add the templates --- doc/Makefile | 1 + .../_templates/autoapi/python/class.rst | 212 +++++++++++++++ .../_templates/autoapi/python/module.rst | 252 ++++++++++++++++++ 3 files changed, 465 insertions(+) create mode 100644 doc/source/_templates/autoapi/python/class.rst create mode 100644 doc/source/_templates/autoapi/python/module.rst diff --git a/doc/Makefile b/doc/Makefile index 67dc7deba0..63604f2462 100755 --- a/doc/Makefile +++ b/doc/Makefile @@ -23,6 +23,7 @@ help: clean: rm -rf _build find . -type d -name "_autosummary" -exec rm -rf {} + + rm -rf source/api/ # Create PDF pdf: diff --git a/doc/source/_templates/autoapi/python/class.rst b/doc/source/_templates/autoapi/python/class.rst new file mode 100644 index 0000000000..8353ea1b16 --- /dev/null +++ b/doc/source/_templates/autoapi/python/class.rst @@ -0,0 +1,212 @@ +{% if obj.display %} + +{# ----------------- Start macros definition for tab item ------------------#} +{% macro tab_item_from_objects_list(objects_list, title="") -%} + + .. tab-item:: {{ title }} + + .. list-table:: + :header-rows: 0 + :widths: auto + + {% for obj in objects_list %} + * - :py:attr:`~{{ obj.name }}` + - {{ obj.summary }} + {% endfor %} +{%- endmacro %} + +{# ------------------------ End macros definition for tab ------------------- #} + +{# ----------------- Start macros definition for autosummary -----------------#} + +{% macro autosummary_section(title, members) -%} + +{{ title }} +{{ "-" * title | length }} + +.. autoapisummary:: + + {% for member in members %} + {{ member.id }} + {% endfor %} + +{%- endmacro %} +{# ------------------ End macros definition for autosummary --------------- #} + +{# ----------------- Start macros definition for headers -----------------#} + +{% macro render_members_section(title, members) -%} + +{{ title }} +{{ "-" * title | length }} + + {% for member in members %} +{{ member.render() }} + {% endfor %} + +{%- endmacro %} +{# ------------------ End macros definition for headers --------------- #} + + + {% if is_own_page %} +:class:`{{ obj.name }}` +========={{ "=" * obj.name | length }} + + {% endif %} + {% set visible_children = obj.children|selectattr("display")|list %} + {% set own_page_children = visible_children|selectattr("type", "in", own_page_types)|list %} + {% if is_own_page and own_page_children %} +.. toctree:: + :hidden: + + {% for child in own_page_children %} + {{ child.short_name }}<{{ child.include_path }}> + {% endfor %} + + {% endif %} + +.. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}{% if obj.args %}({{ obj.args }}){% endif %} + + {% for (args, return_annotation) in obj.overloads %} + {{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %} + + {% endfor %} + {% if obj.bases %} + {% if "show-inheritance" in autoapi_options %} + + Bases: {% for base in obj.bases %}{{ base|link_objs }}{% if not loop.last %}, {% endif %}{% endfor %} + {% endif %} + + + {% if "show-inheritance-diagram" in autoapi_options and obj.bases != ["object"] %} + .. autoapi-inheritance-diagram:: {{ obj.obj["full_name"] }} + :parts: 1 + {% if "private-members" in autoapi_options %} + :private-bases: + {% endif %} + + {% endif %} + {% endif %} + {% if obj.docstring %} + + {{ obj.docstring|indent(3) }} + {% endif %} + {% set this_page_children = visible_children|rejectattr("type", "in", own_page_types)|list %} + {% set visible_abstract_methods = [] %} + {% set visible_constructor_methods = [] %} + {% set visible_instance_methods = [] %} + {% set visible_special_methods = [] %} + {% set visible_static_methods = [] %} + {% set visible_properties = this_page_children|selectattr("type", "equalto", "property")|list %} + {% set visible_attributes = this_page_children|selectattr("type", "equalto", "attribute")|list %} + {% set all_visible_methods = this_page_children|selectattr("type", "equalto", "method")|list %} + {% if all_visible_methods %} + {% for element in all_visible_methods %} + {% if "abstractmethod" in element.properties %} + {% set _ = visible_abstract_methods.append(element) %} + + {% elif "staticmethod" in element.properties %} + {% set _ = visible_static_methods.append(element) %} + + {% elif "classmethod" in element.properties or element.name in ["__new__", "__init__"] %} + {% set _ = visible_constructor_methods.append(element) %} + + {% elif element.name.startswith("__") and element.name.endswith("__") and element.name not in ["__new__", "__init__"] %} + {% set _ = visible_special_methods.append(element) %} + + {% else %} + {% set _ = visible_instance_methods.append(element) %} + {% endif %} + {% endfor %} + {% endif %} + + {% if this_page_children %} + +.. py:currentmodule:: {{ obj.short_name }} +{# ------------------------- Begin tab-set definition ----------------------- #} + +Overview +-------- + +.. tab-set:: + + {% if visible_abstract_methods %} + {{ tab_item_from_objects_list(visible_abstract_methods, "Abstract methods") }} + {% endif %} + + {% if visible_constructor_methods %} + {{ tab_item_from_objects_list(visible_constructor_methods, "Constructors") }} + {% endif %} + + {% if visible_instance_methods %} + {{ tab_item_from_objects_list(visible_instance_methods, "Methods") }} + {% endif %} + + {% if visible_properties %} + {{ tab_item_from_objects_list(visible_properties, "Properties") }} + {% endif %} + + {% if visible_attributes %} + {{ tab_item_from_objects_list(visible_attributes, "Attributes") }} + {% endif %} + + {% if visible_static_methods %} + {{ tab_item_from_objects_list(visible_static_methods, "Static methods") }} + {% endif %} + + {% if visible_special_methods %} + {{ tab_item_from_objects_list(visible_special_methods, "Special methods") }} + {% endif %} + + {% endif %} +{# ---------------------- End class tabset -------------------- #} + +{# ---------------------- Begin class details -------------------- #} + +Import detail +------------- +{% set split_parts = obj.obj["full_name"].split('.') %} +{% set joined_parts = '.'.join(split_parts[:-1]) %} + +.. code-block:: python + + from {{ joined_parts }} import {{ obj["short_name"] }} + + {% if visible_properties %} +{{ render_members_section("Property detail", visible_properties) }} + {% endif %} + + {% if visible_attributes %} +{{ render_members_section("Attribute detail", visible_attributes) }} + {% endif %} + + {% if all_visible_methods %} +{{ render_members_section("Method detail", all_visible_methods) }} + {% endif %} + + {% if is_own_page and own_page_children %} + {% set visible_attributes = own_page_children|selectattr("type", "equalto", "attribute")|list %} + + {% if visible_attributes %} +{{ autosummary_section("Attributes", visible_attributes) }} + {% endif %} + {% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %} + + {% if visible_exceptions %} +{{ autosummary_section("Exceptions", visible_exceptions) }} + {% endif %} + {% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %} + + {% if visible_classes %} +{{ autosummary_section("Classes", visible_classes) }} + + {% endif %} + {% set visible_methods = own_page_children|selectattr("type", "equalto", "method")|list %} + + {% if visible_methods %} +{{ autosummary_section("Methods", visible_methods) }} + {% endif %} + {% endif %} + +{# ---------------------- End class details -------------------- #} +{% endif %} diff --git a/doc/source/_templates/autoapi/python/module.rst b/doc/source/_templates/autoapi/python/module.rst new file mode 100644 index 0000000000..2cc1f662c1 --- /dev/null +++ b/doc/source/_templates/autoapi/python/module.rst @@ -0,0 +1,252 @@ +{# ------------------------- Begin macros definition ----------------------- #} + +{% macro tab_item_from_objects_list(objects_list, title="") -%} + + .. tab-item:: {{ title }} + + .. list-table:: + :header-rows: 0 + :widths: auto + + {% for obj in objects_list %} + + {% if obj.type in own_page_types %} + * - :py:obj:`~{{ obj.id }}` + {% else %} + * - :py:obj:`~{{ obj.short_name }}` + {% endif %} + - {{ obj.summary }} + + {% endfor %} + +{%- endmacro %} + +{% macro toctree_from_objects_list(objects_list, icon="") -%} + +.. toctree:: + :titlesonly: + :maxdepth: 1 + :hidden: + + {% for obj in objects_list %} + {{ obj.short_name }}<{{ obj.include_path }}> + {% endfor %} +{%- endmacro %} + +{# --------------------------- End macros definition ----------------------- #} + +{% if not obj.display %} +:orphan: +{% endif %} + +{% if is_own_page %} + + {% if obj.name.split(".") | length == 3 %} +The ``{{ obj.name }}`` library +{{ "================" + "=" * obj.name|length }} + {% else %} + {% if obj.type == "package" %} +The ``{{ obj.short_name }}`` package +{{ "====================" + "=" * obj.short_name|length }} + {% else %} +The ``{{ obj.short_name }}.py`` module +{{ "==================" + "=" * obj.short_name|length }} + {% endif %} + {% endif %} +{% endif %} + +.. py:module:: {{ obj.name }} + +{# ---------------------- Begin module summary -------------------- #} + +Summary +------- + +{% if obj.all is not none %} +{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %} +{% elif obj.type is equalto("package") %} +{% set visible_children = obj.children|selectattr("display")|list %} +{% else %} +{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %} +{% endif %} + +{% set visible_subpackages = obj.subpackages|selectattr("display")|list %} +{% set visible_submodules = obj.submodules|selectattr("display")|list %} + +{% set visible_classes_and_interfaces = visible_children|selectattr("type", "equalto", "class")|list %} +{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} +{% set visible_attributes_and_constants = visible_children|selectattr("type", "equalto", "data")|list %} +{% set visible_exceptions = visible_children|selectattr("type", "equalto", "exception")|list %} + +{% set visible_classes = [] %} +{% set visible_interfaces = [] %} +{% set visible_enums = [] %} +{% for element in visible_classes_and_interfaces %} + + {# + HACK: there is not built-in "startswith" test, no "break" statement, and + no limited scope for variables inside blocks, see: + https://stackoverflow.com/questions/4870346/can-a-jinja-variables-scope-extend-beyond-in-an-inner-block + #} + {% set has_enum_base = [] %} + {% for base in element.bases %} + {% if base.startswith("enum.") %} + {% set _ = has_enum_base.append(true) %} + {% endif %} + {% endfor %} + + {% if has_enum_base %} + {% set _ = visible_enums.append(element) %} + {% elif element.name.startswith("I") and element.name[1].isupper() and not has_enum_base %} + {% set _ = visible_interfaces.append(element) %} + {% else %} + {% set _ = visible_classes.append(element) %} + {% endif %} +{% endfor %} + +{% set visible_attributes = [] %} +{% set visible_constants = [] %} +{% for element in visible_attributes_and_constants %} + {% if element.name.isupper() %} + {% set _ = visible_constants.append(element) %} + {% else %} + {% set _ = visible_attributes.append(element) %} + {% endif %} +{% endfor %} + +{% set module_objects = visible_subpackages + visible_submodules + visible_classes + visible_interfaces + visible_enums + visible_exceptions + visible_functions + visible_constants + visible_attributes %} + +{# ---------------------- End module summary -------------------- #} +{# ---------------------- Begin module tabset -------------------- #} +{% if module_objects %} + +.. py:currentmodule:: {{ obj.short_name }} +.. tab-set:: + +{% if visible_subpackages %} + {{ tab_item_from_objects_list(visible_subpackages, "Subpackages") }} +{% endif %} + +{% if visible_submodules %} + {{ tab_item_from_objects_list(visible_submodules, "Submodules") }} +{% endif %} + +{% if visible_interfaces %} + {{ tab_item_from_objects_list(visible_interfaces, "Interfaces") }} +{% endif %} + +{% if visible_classes %} + {{ tab_item_from_objects_list(visible_classes, "Classes") }} +{% endif %} + +{% if visible_enums %} + {{ tab_item_from_objects_list(visible_enums, "Enums") }} +{% endif %} + +{% if visible_exceptions %} + {{ tab_item_from_objects_list(visible_exceptions, "Exceptions") }} +{% endif %} + +{% if visible_functions %} + {{ tab_item_from_objects_list(visible_functions, "Functions") }} +{% endif %} + +{% if visible_attributes %} + {{ tab_item_from_objects_list(visible_attributes, "Attributes") }} +{% endif %} + +{% if visible_constants %} + {{ tab_item_from_objects_list(visible_constants, "Constants") }} +{% endif %} +{% endif %} + +{# ---------------------- End module tabset -------------------- #} +{# ------------------------ Begin toctree definition ----------------------- #} + +{% block subpackages %} +{% if visible_subpackages %} +{{ toctree_from_objects_list(visible_subpackages, "nf nf-md-package") }} +{% endif %} +{% endblock %} + +{% block submodules %} +{% if visible_submodules %} +{{ toctree_from_objects_list(visible_submodules, "nf nf-fa-file") }} +{% endif %} +{% endblock %} + +{% block class %} +{% if own_page_types and "class" in own_page_types %} +{% if visible_interfaces %} +{{ toctree_from_objects_list(visible_interfaces, "nf nf-cod-symbol_interface") }} +{% endif %} + +{% if visible_classes %} +{{ toctree_from_objects_list(visible_classes, "nf nf-cod-symbol_class") }} +{% endif %} + +{% if visible_enums %} +{{ toctree_from_objects_list(visible_enums, "nf nf-cod-symbol_enum") }} +{% endif %} + +{% if visible_exceptions %} +{{ toctree_from_objects_list(visible_exceptions, "nf nf-md-lightning_bolt") }} +{% endif %} +{% endif %} +{% endblock %} + +{% block functions %} +{% if own_page_types and visible_functions and "function" in own_page_types %} +{{ toctree_from_objects_list(visible_functions, "nf nf-md-function_variant") }} +{% endif %} +{% endblock %} + +{% block constants %} +{% if own_page_types and visible_constants and "constant" in own_page_types %} +{{ toctree_from_objects_list(visible_constants, "nf nf-cod-symbol_constant") }} +{% endif %} +{% endblock %} + +{# ------------------------- End toctree definition ------------------------ #} + + +{# ------------------------ Begin module description ----------------------- #} + +{% if obj.docstring %} +Description +----------- + +{{ obj.docstring }} +{% endif %} + +{# ------------------------- End module description ------------------------ #} + + +{# -------------------------- Begin module detail -------------------------- #} + +{% set module_objects_in_this_page = visible_classes + visible_interfaces + visible_enums + visible_exceptions + visible_functions + visible_constants + visible_attributes %} +{% if module_objects_in_this_page %} +{% set visible_objects_in_this_page = [] %} + +{% if own_page_types %} + {% for obj in module_objects_in_this_page %} + {% if obj.type not in own_page_types %} + {% set _ = visible_objects_in_this_page.append(obj) %} + {% endif %} + {% endfor %} +{% else %} + {% set visible_objects_in_this_page = module_objects_in_this_page %} +{% endif %} + +{% if visible_objects_in_this_page %} +Module detail +------------- + + {% for obj in visible_objects_in_this_page %} +{{ obj.render() }} + {% endfor %} + +{% endif %} +{% endif %} + +{# ---------------------- End module detail description -------------------- #} From 6a429826f01a14c833fc7ef335b76e33581b1973 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 3 Jul 2025 11:03:47 +0200 Subject: [PATCH 19/28] fix: update the prime mesh --- doc/source/_templates/autoapi/python/module.rst | 14 +++++--------- doc/source/conf.py | 1 + 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/source/_templates/autoapi/python/module.rst b/doc/source/_templates/autoapi/python/module.rst index 2cc1f662c1..63ddab5fcc 100644 --- a/doc/source/_templates/autoapi/python/module.rst +++ b/doc/source/_templates/autoapi/python/module.rst @@ -123,10 +123,6 @@ Summary .. py:currentmodule:: {{ obj.short_name }} .. tab-set:: -{% if visible_subpackages %} - {{ tab_item_from_objects_list(visible_subpackages, "Subpackages") }} -{% endif %} - {% if visible_submodules %} {{ tab_item_from_objects_list(visible_submodules, "Submodules") }} {% endif %} @@ -163,11 +159,11 @@ Summary {# ---------------------- End module tabset -------------------- #} {# ------------------------ Begin toctree definition ----------------------- #} -{% block subpackages %} -{% if visible_subpackages %} -{{ toctree_from_objects_list(visible_subpackages, "nf nf-md-package") }} -{% endif %} -{% endblock %} +.. {% block subpackages %} +.. {% if visible_subpackages %} +.. {{ toctree_from_objects_list(visible_subpackages, "nf nf-md-package") }} +.. {% endif %} +.. {% endblock %} {% block submodules %} {% if visible_submodules %} diff --git a/doc/source/conf.py b/doc/source/conf.py index ceb5566e88..d4e7b4c6ac 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -76,6 +76,7 @@ 'undoc-members', 'private-members', 'show-inheritance', + 'inherited-members', 'show-module-summary', 'special-members', 'imported-members', From 571e95cfbe5fc853d608d50454dd2c30e3528486 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 3 Jul 2025 12:27:58 +0200 Subject: [PATCH 20/28] fix: supress warnings in sphinx build --- doc/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index d4e7b4c6ac..b8059594dc 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -74,8 +74,6 @@ "options": [ 'members', 'undoc-members', - 'private-members', - 'show-inheritance', 'inherited-members', 'show-module-summary', 'special-members', @@ -113,6 +111,8 @@ "toc.not_readable", "autoapi.python_import_resolution", "toc.not_included", + "ref.ref", + "ref.python", ] # Intersphinx mapping From c89f94417efc8ea3f8f029caccc8f4939729fd4b Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 3 Jul 2025 14:03:05 +0200 Subject: [PATCH 21/28] fix(docs): remove outdated theme options --- doc/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index b8059594dc..2737a3771e 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -41,7 +41,6 @@ "version_match": get_version_match(__version__), }, "check_switcher": False, - "navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"], "navigation_with_keys": False, "github_url": "https://github.com/ansys/pyprimemesh", "show_prev_next": False, From 94ff0fe00a0e8ec0d3d765c8b0cba495881dab48 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 3 Jul 2025 14:06:12 +0200 Subject: [PATCH 22/28] fix(docs): remove black check on templates --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index beadc087f6..18c060af8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,10 @@ repos: hooks: - id: blacken-docs additional_dependencies: [black==22.12.0] + exclude: | + (?x)^( + doc/source/_templates/ + ) - repo: https://github.com/PyCQA/flake8 rev: 6.0.0 From 95df771fd6bbfa5dd6221642c5364dfcc013c898 Mon Sep 17 00:00:00 2001 From: afernand Date: Thu, 3 Jul 2025 15:12:52 +0200 Subject: [PATCH 23/28] fix: Remove doc style dependency --- .github/workflows/ci_cd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 9e4a6c6c19..73c323f20d 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -103,7 +103,6 @@ jobs: name: Documentation if: github.event.action != 'closed' runs-on: public-ubuntu-latest-16-cores - needs: [docs-style] steps: - name: Login in Github Container registry uses: docker/login-action@v3 From 68e7af9b89e5f5f9a356e72c7e0c4c6a2da4bfe8 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 3 Jul 2025 15:16:39 +0200 Subject: [PATCH 24/28] fix: remove vale from templates --- doc/source/_templates/autoapi/python/class.rst | 4 ++++ doc/source/_templates/autoapi/python/module.rst | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/source/_templates/autoapi/python/class.rst b/doc/source/_templates/autoapi/python/class.rst index 8353ea1b16..aefbf0b89f 100644 --- a/doc/source/_templates/autoapi/python/class.rst +++ b/doc/source/_templates/autoapi/python/class.rst @@ -1,4 +1,5 @@ {% if obj.display %} +.. vale off {# ----------------- Start macros definition for tab item ------------------#} {% macro tab_item_from_objects_list(objects_list, title="") -%} @@ -210,3 +211,6 @@ Import detail {# ---------------------- End class details -------------------- #} {% endif %} + + +.. vale on \ No newline at end of file diff --git a/doc/source/_templates/autoapi/python/module.rst b/doc/source/_templates/autoapi/python/module.rst index 63ddab5fcc..5787e84a44 100644 --- a/doc/source/_templates/autoapi/python/module.rst +++ b/doc/source/_templates/autoapi/python/module.rst @@ -1,3 +1,5 @@ + +.. vale off {# ------------------------- Begin macros definition ----------------------- #} {% macro tab_item_from_objects_list(objects_list, title="") -%} @@ -246,3 +248,5 @@ Module detail {% endif %} {# ---------------------- End module detail description -------------------- #} + +.. vale on \ No newline at end of file From 170eae8ff421f75f84a536ada94e2380736f6951 Mon Sep 17 00:00:00 2001 From: afernand Date: Thu, 3 Jul 2025 15:20:11 +0200 Subject: [PATCH 25/28] fix: Revert CI change --- .github/workflows/ci_cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 73c323f20d..9e4a6c6c19 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -103,6 +103,7 @@ jobs: name: Documentation if: github.event.action != 'closed' runs-on: public-ubuntu-latest-16-cores + needs: [docs-style] steps: - name: Login in Github Container registry uses: docker/login-action@v3 From 40ec038cc98ed8781cf647821a1792d93802a1cd Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 3 Jul 2025 15:22:34 +0200 Subject: [PATCH 26/28] fix: update the condition --- doc/source/_templates/autoapi/python/class.rst | 3 ++- doc/source/_templates/autoapi/python/module.rst | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/_templates/autoapi/python/class.rst b/doc/source/_templates/autoapi/python/class.rst index aefbf0b89f..28c27e8f64 100644 --- a/doc/source/_templates/autoapi/python/class.rst +++ b/doc/source/_templates/autoapi/python/class.rst @@ -1,6 +1,7 @@ -{% if obj.display %} .. vale off +{% if obj.display %} + {# ----------------- Start macros definition for tab item ------------------#} {% macro tab_item_from_objects_list(objects_list, title="") -%} diff --git a/doc/source/_templates/autoapi/python/module.rst b/doc/source/_templates/autoapi/python/module.rst index 5787e84a44..9afea58242 100644 --- a/doc/source/_templates/autoapi/python/module.rst +++ b/doc/source/_templates/autoapi/python/module.rst @@ -1,5 +1,6 @@ .. vale off + {# ------------------------- Begin macros definition ----------------------- #} {% macro tab_item_from_objects_list(objects_list, title="") -%} From 30db3aaee45b72bbd681be2a70838eb9957b150e Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 4 Jul 2025 14:02:52 +0200 Subject: [PATCH 27/28] fix: add alphabetica order --- .../_templates/autoapi/python/module.rst | 96 ++++++++++++++++--- doc/source/conf.py | 1 + 2 files changed, 84 insertions(+), 13 deletions(-) diff --git a/doc/source/_templates/autoapi/python/module.rst b/doc/source/_templates/autoapi/python/module.rst index 9afea58242..81688fb495 100644 --- a/doc/source/_templates/autoapi/python/module.rst +++ b/doc/source/_templates/autoapi/python/module.rst @@ -80,9 +80,7 @@ Summary {% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} {% set visible_attributes_and_constants = visible_children|selectattr("type", "equalto", "data")|list %} {% set visible_exceptions = visible_children|selectattr("type", "equalto", "exception")|list %} - {% set visible_classes = [] %} -{% set visible_interfaces = [] %} {% set visible_enums = [] %} {% for element in visible_classes_and_interfaces %} @@ -100,8 +98,6 @@ Summary {% if has_enum_base %} {% set _ = visible_enums.append(element) %} - {% elif element.name.startswith("I") and element.name[1].isupper() and not has_enum_base %} - {% set _ = visible_interfaces.append(element) %} {% else %} {% set _ = visible_classes.append(element) %} {% endif %} @@ -117,7 +113,87 @@ Summary {% endif %} {% endfor %} -{% set module_objects = visible_subpackages + visible_submodules + visible_classes + visible_interfaces + visible_enums + visible_exceptions + visible_functions + visible_constants + visible_attributes %} + +{# Deduplicate visible_classes by name #} +{% set seen_names = [] %} +{% set deduped_classes = [] %} + +{% for cls in visible_classes %} + {% if cls.name not in seen_names %} + {% set _ = seen_names.append(cls.name) %} + {# Only append if the class is not already in deduped_classes #} + {% if cls not in deduped_classes %} + {% set _ = deduped_classes.append(cls) %} + {% endif %} + {% endif %} +{% endfor %} + +{% set visible_classes = deduped_classes %} + +{# Deduplicate visible_constants by name #} +{% set seen_constants = [] %} +{% set deduped_constants = [] %} + +{% for const in visible_constants %} + {% if const.name not in seen_constants %} + {% set _ = seen_constants.append(const.name) %} + {# Only append if the constant is not already in deduped_constants #} + {% if const not in deduped_constants %} + {% set _ = deduped_constants.append(const) %} + {% endif %} + {% endif %} +{% endfor %} + +{% set visible_constants = deduped_constants %} + +{# Deduplicate visible_attributes by name #} +{% set seen_attributes = [] %} +{% set deduped_attributes = [] %} + +{% for attr in visible_attributes %} + {% if attr.name not in seen_attributes %} + {% set _ = seen_attributes.append(attr.name) %} + {# Only append if the attribute is not already in deduped_attributes #} + {% if attr not in deduped_attributes %} + {% set _ = deduped_attributes.append(attr) %} + {% endif %} + {% endif %} +{% endfor %} + +{% set visible_attributes = deduped_attributes %} +{# Deduplicate visible_enums by name #} +{% set seen_enums = [] %} +{% set deduped_enums = [] %} + +{% for enum in visible_enums %} + {% if enum.name not in seen_enums %} + {% set _ = seen_enums.append(enum.name) %} + {# Only append if the enum is not already in deduped_enums #} + {% if enum not in deduped_enums %} + {% set _ = deduped_enums.append(enum) %} + {% endif %} + {% endif %} +{% endfor %} + +{% set visible_enums = deduped_enums %} + +{# Deduplicate visible_exceptions by name #} +{% set seen_exceptions = [] %} +{% set deduped_exceptions = [] %} + +{% for exc in visible_exceptions %} + {% if exc.name not in seen_exceptions %} + {% set _ = seen_exceptions.append(exc.name) %} + {# Only append if the exception is not already in deduped_exceptions #} + {% if exc not in deduped_exceptions %} + {% set _ = deduped_exceptions.append(exc) %} + {% endif %} + {% endif %} +{% endfor %} + +{% set visible_exceptions = deduped_exceptions %} + +{% set module_objects = visible_subpackages + visible_submodules + visible_classes + visible_enums + visible_exceptions + visible_functions + visible_constants + visible_attributes %} {# ---------------------- End module summary -------------------- #} {# ---------------------- Begin module tabset -------------------- #} @@ -130,10 +206,6 @@ Summary {{ tab_item_from_objects_list(visible_submodules, "Submodules") }} {% endif %} -{% if visible_interfaces %} - {{ tab_item_from_objects_list(visible_interfaces, "Interfaces") }} -{% endif %} - {% if visible_classes %} {{ tab_item_from_objects_list(visible_classes, "Classes") }} {% endif %} @@ -176,9 +248,7 @@ Summary {% block class %} {% if own_page_types and "class" in own_page_types %} -{% if visible_interfaces %} -{{ toctree_from_objects_list(visible_interfaces, "nf nf-cod-symbol_interface") }} -{% endif %} + {% if visible_classes %} {{ toctree_from_objects_list(visible_classes, "nf nf-cod-symbol_class") }} @@ -223,7 +293,7 @@ Description {# -------------------------- Begin module detail -------------------------- #} -{% set module_objects_in_this_page = visible_classes + visible_interfaces + visible_enums + visible_exceptions + visible_functions + visible_constants + visible_attributes %} +{% set module_objects_in_this_page = visible_classes + visible_enums + visible_exceptions + visible_functions + visible_constants + visible_attributes %} {% if module_objects_in_this_page %} {% set visible_objects_in_this_page = [] %} diff --git a/doc/source/conf.py b/doc/source/conf.py index e04033176d..1277af2883 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -85,6 +85,7 @@ 'special-members', 'imported-members', ], + "member_order": "alphabetical", }, } From 379aa5e6af7a229957b07bb3df6476c0e82aff67 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Mon, 7 Jul 2025 10:48:59 +0200 Subject: [PATCH 28/28] fix: own page level --- doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 1277af2883..b170b5a7e2 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -86,6 +86,7 @@ 'imported-members', ], "member_order": "alphabetical", + "own_page_level": "function", }, }