Skip to content

maint: Migrate autoAPI to ansys-sphinx-theme autoAPI #1061

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b360efd
maint: Migrate autoAPI to ansys-sphinx-theme autoAPI
AlejandroFernandezLuces Jun 16, 2025
a708935
chore: adding changelog file 1061.documentation.md [dependabot-skip]
pyansys-ci-bot Jun 16, 2025
a7ff8de
Merge branch 'main' into maint/migrate-autoapi
AlejandroFernandezLuces Jun 24, 2025
7c3ec26
chore: adding changelog file 1061.miscellaneous.md [dependabot-skip]
pyansys-ci-bot Jun 24, 2025
21ff890
fix: Add missing init files
AlejandroFernandezLuces Jun 24, 2025
8448ee9
fix: Revert examples
AlejandroFernandezLuces Jun 24, 2025
cc8d394
fix: Typo
AlejandroFernandezLuces Jun 26, 2025
37bd8ba
fix: add package depth for 3 spacing
Revathyvenugopal162 Jun 27, 2025
4094b92
fix: typo in makefile
Revathyvenugopal162 Jun 27, 2025
b7e4f5f
docs(autoapi): ignore patterns
Revathyvenugopal162 Jun 27, 2025
481e182
docs(autoapi): add inline comment
Revathyvenugopal162 Jun 27, 2025
e7565c3
Merge branch 'main' into maint/migrate-autoapi
AlejandroFernandezLuces Jun 30, 2025
cf38897
fix: pre-commit
AlejandroFernandezLuces Jun 30, 2025
0b64211
fix(code): add all methods
Revathyvenugopal162 Jun 30, 2025
484a159
Merge branch 'maint/migrate-autoapi' of https://github.com/ansys/pypr…
Revathyvenugopal162 Jun 30, 2025
429c0eb
chore: adding changelog file 1061.maintenance.md [dependabot-skip]
pyansys-ci-bot Jun 30, 2025
33edc89
fix: update the docs
Revathyvenugopal162 Jun 30, 2025
71af082
Merge branch 'maint/migrate-autoapi' of https://github.com/ansys/pypr…
Revathyvenugopal162 Jun 30, 2025
5996dd2
fix: precommit
Revathyvenugopal162 Jun 30, 2025
cd5fd6d
Merge branch 'main' into maint/migrate-autoapi
AlejandroFernandezLuces Jun 30, 2025
32da2d6
fix: Test
AlejandroFernandezLuces Jul 1, 2025
be4a0d1
Merge branch 'maint/migrate-autoapi' of https://github.com/ansys/pypr…
AlejandroFernandezLuces Jul 1, 2025
6d91292
fix: Import
AlejandroFernandezLuces Jul 1, 2025
3e92ce6
fix(template): add the templates
Revathyvenugopal162 Jul 1, 2025
a043a74
Merge branch 'maint/migrate-autoapi' of https://github.com/ansys/pypr…
Revathyvenugopal162 Jul 1, 2025
6a42982
fix: update the prime mesh
Revathyvenugopal162 Jul 3, 2025
571e95c
fix: supress warnings in sphinx build
Revathyvenugopal162 Jul 3, 2025
c89f944
fix(docs): remove outdated theme options
Revathyvenugopal162 Jul 3, 2025
94ff0fe
fix(docs): remove black check on templates
Revathyvenugopal162 Jul 3, 2025
3d6968a
Merge branch 'main' into maint/migrate-autoapi
AlejandroFernandezLuces Jul 3, 2025
95df771
fix: Remove doc style dependency
AlejandroFernandezLuces Jul 3, 2025
68e7af9
fix: remove vale from templates
Revathyvenugopal162 Jul 3, 2025
2e3ead9
Merge branch 'maint/migrate-autoapi' of https://github.com/ansys/pypr…
Revathyvenugopal162 Jul 3, 2025
170eae8
fix: Revert CI change
AlejandroFernandezLuces Jul 3, 2025
2ebd270
Merge branch 'main' into maint/migrate-autoapi
AlejandroFernandezLuces Jul 3, 2025
40ec038
fix: update the condition
Revathyvenugopal162 Jul 3, 2025
6c004f3
Merge branch 'maint/migrate-autoapi' of https://github.com/ansys/pypr…
Revathyvenugopal162 Jul 3, 2025
30db3aa
fix: add alphabetica order
Revathyvenugopal162 Jul 4, 2025
379aa5e
fix: own page level
Revathyvenugopal162 Jul 7, 2025
de90689
Merge branch 'main' into maint/migrate-autoapi
AlejandroFernandezLuces Jul 8, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dist/
_autosummary
_build/
_gallery_backreferences
doc/source/api

# Testing
.coverage
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ help:

# customized clean due to examples gallery
clean:
rm -rf build
rm -rf _build
find . -type d -name "_autosummary" -exec rm -rf {} +
rm -rf source/api/

# Create PDF
pdf:
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1061.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Maint: migrate autoapi to ansys-sphinx-theme autoapi
14 changes: 14 additions & 0 deletions doc/source/_templates/autoapi/index.rst
Original file line number Diff line number Diff line change
@@ -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

<span class="nf nf-md-package"></span> ansys.meshing.prime</api/ansys/meshing/prime/index>
<span class="nf nf-md-package"></span> ansys.meshing.prime.lucid</api/ansys/meshing/prime/lucid/index>
<span class="nf nf-md-package"></span> ansys.meshing.prime.examples</api/ansys/meshing/prime/examples/index>
<span class="nf nf-md-package"></span> ansys.meshing.prime.graphics</api/ansys/meshing/prime/graphics/index>
217 changes: 217 additions & 0 deletions doc/source/_templates/autoapi/python/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
.. vale off

{% 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 %}


.. vale on
Loading
Loading