Skip to content
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

WIP: Use sphinx autoapi #4841

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
136 changes: 116 additions & 20 deletions doc/source/API/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,123 @@ Example with ``Desktop`` class implicit initialization:
circuit.release_desktop()


.. .. toctree::
.. :maxdepth: 2

.. Application
.. MaterialManagement
.. Primitives3D
.. Primitives2D
.. Primitive_Objects
.. Primitives3DLayout
.. PrimitivesCircuit
.. Boundaries
.. Mesh
.. Setup
.. Post
.. DesktopMessenger
.. Optimetrics
.. Variables
.. Constants
.. Configuration
.. SetupTemplates
.. CableModeling
.. toctree::
:maxdepth: 2

Application
MaterialManagement
Primitives3D
Primitives2D
Primitive_Objects
Primitives3DLayout
PrimitivesCircuit
Boundaries
Mesh
Setup
Post
DesktopMessenger
Optimetrics
Variables
Constants
Configuration
SetupTemplates
CableModeling
:titlesonly:
:maxdepth: 3

<span class="nf nf-md-package"></span> pyaedt.misc.misc</api/pyaedt/misc/misc/index>
<span class="nf nf-md-package"></span> pyaedt.generic.pdf</api/pyaedt/generic/pdf/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.cad</api/pyaedt/modeler/cad/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.pcb</api/pyaedt/modeler/pcb/index>
<span class="nf nf-md-package"></span> pyaedt.generic.plot</api/pyaedt/generic/plot/index>
<span class="nf nf-md-package"></span> pyaedt.modules.Mesh</api/pyaedt/modules/Mesh/index>
<span class="nf nf-md-package"></span> pyaedt.sbrplus.plot</api/pyaedt/sbrplus/plot/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.q2d</api/pyaedt/workflows/q2d/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.q3d</api/pyaedt/workflows/q3d/index>
<span class="nf nf-md-package"></span> pyaedt.generic.spisim</api/pyaedt/generic/spisim/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.misc</api/pyaedt/workflows/misc/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.emit</api/pyaedt/workflows/emit/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.hfss</api/pyaedt/workflows/hfss/index>
<span class="nf nf-md-package"></span> pyaedt.generic.settings</api/pyaedt/generic/settings/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.circuits</api/pyaedt/modeler/circuits/index>
<span class="nf nf-md-package"></span> pyaedt.modules.Boundary</api/pyaedt/modules/Boundary/index>
<span class="nf nf-md-package"></span> pyaedt.modules.Material</api/pyaedt/modules/Material/index>
<span class="nf nf-md-package"></span> pyaedt.rpc.local_server</api/pyaedt/rpc/local_server/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.icepak</api/pyaedt/workflows/icepak/index>
<span class="nf nf-md-package"></span> pyaedt.emit_core.results</api/pyaedt/emit_core/results/index>
<span class="nf nf-md-package"></span> pyaedt.generic.constants</api/pyaedt/generic/constants/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.modeler2d</api/pyaedt/modeler/modeler2d/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.modeler3d</api/pyaedt/modeler/modeler3d/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.schematic</api/pyaedt/modeler/schematic/index>
<span class="nf nf-md-package"></span> pyaedt.modules.solutions</api/pyaedt/modules/solutions/index>
<span class="nf nf-md-package"></span> pyaedt.rpc.rpyc_services</api/pyaedt/rpc/rpyc_services/index>
<span class="nf nf-md-package"></span> pyaedt.sbrplus.hdm_utils</api/pyaedt/sbrplus/hdm_utils/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.circuit</api/pyaedt/workflows/circuit/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.project</api/pyaedt/workflows/project/index>
<span class="nf nf-md-package"></span> pyaedt.application.Design</api/pyaedt/application/Design/index>
<span class="nf nf-md-package"></span> pyaedt.generic.clr_module</api/pyaedt/generic/clr_module/index>
<span class="nf nf-md-package"></span> pyaedt.generic.compliance</api/pyaedt/generic/compliance/index>
<span class="nf nf-md-package"></span> pyaedt.generic.filesystem</api/pyaedt/generic/filesystem/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.modelerpcb</api/pyaedt/modeler/modelerpcb/index>
<span class="nf nf-md-package"></span> pyaedt.modules.MeshIcepak</api/pyaedt/modules/MeshIcepak/index>
<span class="nf nf-md-package"></span> pyaedt.modules.SolveSetup</api/pyaedt/modules/SolveSetup/index>
<span class="nf nf-md-package"></span> pyaedt.sbrplus.hdm_parser</api/pyaedt/sbrplus/hdm_parser/index>
<span class="nf nf-md-package"></span> pyaedt.emit_core.Couplings</api/pyaedt/emit_core/Couplings/index>
<span class="nf nf-md-package"></span> pyaedt.generic.ibis_reader</api/pyaedt/generic/ibis_reader/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.calculators</api/pyaedt/modeler/calculators/index>
<span class="nf nf-md-package"></span> pyaedt.modules.MaterialLib</api/pyaedt/modules/MaterialLib/index>
<span class="nf nf-md-package"></span> pyaedt.modules.SolveSweeps</api/pyaedt/modules/SolveSweeps/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.installer</api/pyaedt/workflows/installer/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.maxwell2d</api/pyaedt/workflows/maxwell2d/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.maxwell3d</api/pyaedt/workflows/maxwell3d/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.templates</api/pyaedt/workflows/templates/index>
<span class="nf nf-md-package"></span> pyaedt.application.Analysis</api/pyaedt/application/Analysis/index>
<span class="nf nf-md-package"></span> pyaedt.generic.DataHandlers</api/pyaedt/generic/DataHandlers/index>
<span class="nf nf-md-package"></span> pyaedt.generic.design_types</api/pyaedt/generic/design_types/index>
<span class="nf nf-md-package"></span> pyaedt.generic.LoadAEDTFile</api/pyaedt/generic/LoadAEDTFile/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.advanced_cad</api/pyaedt/modeler/advanced_cad/index>
<span class="nf nf-md-package"></span> pyaedt.modules.LayerStackup</api/pyaedt/modules/LayerStackup/index>
<span class="nf nf-md-package"></span> pyaedt.modules.Mesh3DLayout</api/pyaedt/modules/Mesh3DLayout/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.mechanical</api/pyaedt/workflows/mechanical/index>
<span class="nf nf-md-package"></span> pyaedt.application.Variables</api/pyaedt/application/Variables/index>
<span class="nf nf-md-package"></span> pyaedt.modules.CableModeling</api/pyaedt/modules/CableModeling/index>
<span class="nf nf-md-package"></span> pyaedt.modules.PostProcessor</api/pyaedt/modules/PostProcessor/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.twinbuilder</api/pyaedt/workflows/twinbuilder/index>
<span class="nf nf-md-package"></span> pyaedt.application.Analysis3D</api/pyaedt/application/Analysis3D/index>
<span class="nf nf-md-package"></span> pyaedt.application.JobManager</api/pyaedt/application/JobManager/index>
<span class="nf nf-md-package"></span> pyaedt.generic.com_parameters</api/pyaedt/generic/com_parameters/index>
<span class="nf nf-md-package"></span> pyaedt.generic.configurations</api/pyaedt/generic/configurations/index>
<span class="nf nf-md-package"></span> pyaedt.misc.create_remote_dir</api/pyaedt/misc/create_remote_dir/index>
<span class="nf nf-md-package"></span> pyaedt.modules.monitor_icepak</api/pyaedt/modules/monitor_icepak/index>
<span class="nf nf-md-package"></span> pyaedt.modules.SetupTemplates</api/pyaedt/modules/SetupTemplates/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.hfss3dlayout</api/pyaedt/workflows/hfss3dlayout/index>
<span class="nf nf-md-package"></span> pyaedt.application.analysis_hf</api/pyaedt/application/analysis_hf/index>
<span class="nf nf-md-package"></span> pyaedt.generic.general_methods</api/pyaedt/generic/general_methods/index>
<span class="nf nf-md-package"></span> pyaedt.application.aedt_objects</api/pyaedt/application/aedt_objects/index>
<span class="nf nf-md-package"></span> pyaedt.emit_core.emit_constants</api/pyaedt/emit_core/emit_constants/index>
<span class="nf nf-md-package"></span> pyaedt.generic.desktop_sessions</api/pyaedt/generic/desktop_sessions/index>
<span class="nf nf-md-package"></span> pyaedt.modules.CircuitTemplates</api/pyaedt/modules/CircuitTemplates/index>
<span class="nf nf-md-package"></span> pyaedt.modules.DesignXPloration</api/pyaedt/modules/DesignXPloration/index>
<span class="nf nf-md-package"></span> pyaedt.modules.report_templates</api/pyaedt/modules/report_templates/index>
<span class="nf nf-md-package"></span> pyaedt.generic.near_field_import</api/pyaedt/generic/near_field_import/index>
<span class="nf nf-md-package"></span> pyaedt.generic.python_optimizers</api/pyaedt/generic/python_optimizers/index>
<span class="nf nf-md-package"></span> pyaedt.generic.touchstone_parser</api/pyaedt/generic/touchstone_parser/index>
<span class="nf nf-md-package"></span> pyaedt.modules.fields_calculator</api/pyaedt/modules/fields_calculator/index>
<span class="nf nf-md-package"></span> pyaedt.application.AnalysisNexxim</api/pyaedt/application/AnalysisNexxim/index>
<span class="nf nf-md-package"></span> pyaedt.application.AnalysisRMxprt</api/pyaedt/application/AnalysisRMxprt/index>
<span class="nf nf-md-package"></span> pyaedt.generic.report_file_parser</api/pyaedt/generic/report_file_parser/index>
<span class="nf nf-md-package"></span> pyaedt.modeler.geometry_operators</api/pyaedt/modeler/geometry_operators/index>
<span class="nf nf-md-package"></span> pyaedt.application.Analysis3DLayout</api/pyaedt/application/Analysis3DLayout/index>
<span class="nf nf-md-package"></span> pyaedt.application.design_solutions</api/pyaedt/application/design_solutions/index>
<span class="nf nf-md-package"></span> pyaedt.modules.OptimetricsTemplates</api/pyaedt/modules/OptimetricsTemplates/index>
<span class="nf nf-md-package"></span> pyaedt.generic.grpc_plugin_dll_class</api/pyaedt/generic/grpc_plugin_dll_class/index>
<span class="nf nf-md-package"></span> pyaedt.modules.AdvancedPostProcessing</api/pyaedt/modules/AdvancedPostProcessing/index>
<span class="nf nf-md-package"></span> pyaedt.application.AnalysisTwinBuilder</api/pyaedt/application/AnalysisTwinBuilder/index>
<span class="nf nf-md-package"></span> pyaedt.application.AEDT_File_Management</api/pyaedt/application/AEDT_File_Management/index>
<span class="nf nf-md-package"></span> pyaedt.application.AnalysisMaxwellCircuit</api/pyaedt/application/AnalysisMaxwellCircuit/index>
<span class="nf nf-md-package"></span> pyaedt.workflows.customize_automation_tab</api/pyaedt/workflows/customize_automation_tab/index>
<span class="nf nf-md-package"></span> pyaedt.misc.spisim_com_configuration_files</api/pyaedt/misc/spisim_com_configuration_files/index>



Expand Down
120 changes: 69 additions & 51 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ def run(self):
addnodes.desc_content('', literal)
]

from ansys_sphinx_theme import get_autoapi_templates_dir_relative_path
autoapi_type = "python"
autoapi_dirs = ["../../pyaedt"]
autoapi_root = "api"
autoapi_options = [
"members",
"undoc-members",
"show-inheritance",
"show-module-summary",
"special-members",
]
autoapi_template_dir = get_autoapi_templates_dir_relative_path(pathlib.Path(__file__))
autoapi_python_use_implicit_namespaces = True
autoapi_keep_files = True
autoapi_own_page_level = "class"
autoapi_add_toctree_entry = False


def autodoc_skip_member(app, what, name, obj, skip, options):
try:
Expand Down Expand Up @@ -140,6 +157,7 @@ def setup(app):
# ones.
extensions = [
"ansys_sphinx_theme.extension.linkcode",
"ansys_sphinx_theme.extension.autoapi",
"numpydoc",
"recommonmark",
"sphinx.ext.autodoc",
Expand Down Expand Up @@ -258,57 +276,57 @@ def setup(app):

# gallery build requires AEDT install
# if is_windows and bool(os.getenv("PYAEDT_CI_RUN_EXAMPLES", "0")):
if run_examples:
import pyvista

# PyVista settings

# Ensure that offscreen rendering is used for docs generation
pyvista.OFF_SCREEN = True
# Save figures in specified directory
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)
# Necessary for pyvista when building the sphinx gallery
pyvista.BUILDING_GALLERY = True

# Manage errors
pyvista.set_error_output_file("errors.txt")
# Must be less than or equal to the XVFB window size
pyvista.global_theme["window_size"] = np.array([1024, 768])

# suppress annoying matplotlib bug
warnings.filterwarnings(
"ignore",
category=UserWarning,
message="Matplotlib is currently using agg, which is a non-GUI backend, so it cannot show the figure.",
)

extensions.append("sphinx_gallery.gen_gallery")
sphinx_gallery_conf = {
# convert rst to md for ipynb
"pypandoc": True,
# path to your examples scripts
"examples_dirs": ["../../examples/"],
# path where to save gallery generated examples
"gallery_dirs": ["examples"],
# Pattern to search for examples files
"filename_pattern": r"\.py",
# Remove the "Download all examples" button from the top level gallery
"download_all_examples": False,
# Sort gallery examples by file name instead of number of lines (default)
"within_subsection_order": FileNameSortKey,
# Directory where function granular galleries are stored
"backreferences_dir": None,
# Modules for which function level galleries are created. In
"doc_module": "ansys-pyaedt",
"image_scrapers": ("pyvista", "matplotlib"),
"ignore_pattern": r"flycheck.*",
"thumbnail_size": (350, 350),
}
if not use_gif:
gif_ignore_pattern = r"|.*Maxwell2D_Transient\.py|.*Maxwell2D_DCConduction\.py|.*Hfss_Icepak_Coupling\.py|.*SBR_Time_Plot\.py"
sphinx_gallery_conf["ignore_pattern"] = sphinx_gallery_conf["ignore_pattern"] + gif_ignore_pattern
# if run_examples:
# import pyvista

# # PyVista settings

# # Ensure that offscreen rendering is used for docs generation
# pyvista.OFF_SCREEN = True
# # Save figures in specified directory
# pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
# if not os.path.exists(pyvista.FIGURE_PATH):
# os.makedirs(pyvista.FIGURE_PATH)
# # Necessary for pyvista when building the sphinx gallery
# pyvista.BUILDING_GALLERY = True

# # Manage errors
# pyvista.set_error_output_file("errors.txt")
# # Must be less than or equal to the XVFB window size
# pyvista.global_theme["window_size"] = np.array([1024, 768])

# # suppress annoying matplotlib bug
# warnings.filterwarnings(
# "ignore",
# category=UserWarning,
# message="Matplotlib is currently using agg, which is a non-GUI backend, so it cannot show the figure.",
# )

# extensions.append("sphinx_gallery.gen_gallery")
# sphinx_gallery_conf = {
# # convert rst to md for ipynb
# "pypandoc": True,
# # path to your examples scripts
# "examples_dirs": ["../../examples/"],
# # path where to save gallery generated examples
# "gallery_dirs": ["examples"],
# # Pattern to search for examples files
# "filename_pattern": r"\.py",
# # Remove the "Download all examples" button from the top level gallery
# "download_all_examples": False,
# # Sort gallery examples by file name instead of number of lines (default)
# "within_subsection_order": FileNameSortKey,
# # Directory where function granular galleries are stored
# "backreferences_dir": None,
# # Modules for which function level galleries are created. In
# "doc_module": "ansys-pyaedt",
# "image_scrapers": ("pyvista", "matplotlib"),
# "ignore_pattern": r"flycheck.*",
# "thumbnail_size": (350, 350),
# }
# if not use_gif:
# gif_ignore_pattern = r"|.*Maxwell2D_Transient\.py|.*Maxwell2D_DCConduction\.py|.*Hfss_Icepak_Coupling\.py|.*SBR_Time_Plot\.py"
# sphinx_gallery_conf["ignore_pattern"] = sphinx_gallery_conf["ignore_pattern"] + gif_ignore_pattern

# -- Options for HTML output -------------------------------------------------
html_short_title = html_title = "PyAEDT"
Expand Down
Loading