From 266028a8174e375d2e92766a9c51665cfcaabef8 Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Sun, 11 Feb 2024 23:08:14 +0100 Subject: [PATCH 1/5] remove autoapi --- doc/source/api/rms.rst | 29 ++++++++++++++++++++++++++++ doc/source/conf.py | 29 +++------------------------- src/ansys/hps/client/rms/__init__.py | 1 + 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/doc/source/api/rms.rst b/doc/source/api/rms.rst index c8b17ba97..0199e8d84 100644 --- a/doc/source/api/rms.rst +++ b/doc/source/api/rms.rst @@ -24,23 +24,52 @@ Evaluator registration ^^^^^^^^^^^^^^^^^^^^^^ .. autopydantic_model:: ansys.hps.client.rms.EvaluatorRegistration + :model-show-json: False + :model-show-config-summary: False + :model-show-validator-members: False + :model-show-validator-summary: False Evaluator configuration ^^^^^^^^^^^^^^^^^^^^^^^ .. autopydantic_model:: ansys.hps.client.rms.EvaluatorConfiguration + :model-show-json: False + :model-show-config-summary: False + :model-show-validator-members: False + :model-show-validator-summary: False Evaluator configuration update ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. autopydantic_model:: ansys.hps.client.rms.EvaluatorConfigurationUpdate + :model-show-json: False + :model-show-config-summary: False + :model-show-validator-members: False + :model-show-validator-summary: False Scaler configuration ^^^^^^^^^^^^^^^^^^^^ .. autopydantic_model:: ansys.hps.client.rms.ScalerRegistration + :model-show-json: False + :model-show-config-summary: False + :model-show-validator-members: False + :model-show-validator-summary: False Compute resource set ^^^^^^^^^^^^^^^^^^^^ .. autopydantic_model:: ansys.hps.client.rms.ComputeResourceSet + :model-show-json: False + :model-show-config-summary: False + :model-show-validator-members: False + :model-show-validator-summary: False + +Cluster info +^^^^^^^^^^^^^^^^^^^^ + +.. autopydantic_model:: ansys.hps.client.rms.ClusterInfo + :model-show-json: False + :model-show-config-summary: False + :model-show-validator-members: False + :model-show-validator-summary: False diff --git a/doc/source/conf.py b/doc/source/conf.py index 16b43405d..2dc910dba 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,15 +1,9 @@ # Sphinx documentation configuration file from datetime import datetime import os -from pathlib import Path import sys -from ansys_sphinx_theme import ( - ansys_favicon, - get_autoapi_templates_dir_relative_path, - get_version_match, - pyansys_logo_black, -) +from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black from ansys.hps.client import __ansys_apps_version__, __version__ @@ -37,33 +31,16 @@ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.autosummary", - "autoapi.extension", "sphinx_autodoc_typehints", "numpydoc", "sphinx.ext.intersphinx", "sphinx_copybutton", "sphinx_design", "sphinx_tabs.tabs", + "sphinxcontrib.autodoc_pydantic", ] -exclude_patterns = ["_autoapi_templates", "_build", "Thumbs.db", ".DS_Store"] - -# Configuration for Sphinx autoapi -autoapi_type = "python" -autoapi_dirs = ["../../src/ansys"] -autoapi_root = "api" -autoapi_options = [ - "members", - "undoc-members", - "show-inheritance", - "show-module-summary", - "special-members", -] -autoapi_template_dir = get_autoapi_templates_dir_relative_path(Path(__file__)) -suppress_warnings = ["autoapi.python_import_resolution"] -autoapi_python_use_implicit_namespaces = True -autoapi_keep_files = True -autoapi_render_in_single_page = ["class", "enum", "exception"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # Intersphinx mapping intersphinx_mapping = { diff --git a/src/ansys/hps/client/rms/__init__.py b/src/ansys/hps/client/rms/__init__.py index 803c4b583..a4fda3758 100644 --- a/src/ansys/hps/client/rms/__init__.py +++ b/src/ansys/hps/client/rms/__init__.py @@ -22,6 +22,7 @@ """PyHPS RMS subpackage.""" from .api.rms_api import RmsApi from .models import ( + ClusterInfo, ComputeResourceSet, EvaluatorConfiguration, EvaluatorConfigurationUpdate, From 8ef2ef85876a7ba807e556e27fcd536b0e6e8ffc Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Mon, 12 Feb 2024 09:37:42 +0100 Subject: [PATCH 2/5] use more autosummary --- .gitignore | 3 +- doc/source/api/auth.rst | 21 ++- doc/source/api/client.rst | 12 +- doc/source/api/exceptions.rst | 13 +- doc/source/api/index.rst | 2 +- doc/source/api/jms.rst | 165 +++++--------------- doc/source/api/rms.rst | 116 ++++++++------ doc/source/conf.py | 9 +- doc/source/user_guide/dcs_migration.rst | 4 +- examples/lsdyna_cylinder_plate/.gitignore | 2 +- src/ansys/hps/client/exceptions.py | 41 ++--- src/ansys/hps/client/jms/api/jms_api.py | 2 +- src/ansys/hps/client/jms/api/project_api.py | 6 +- src/ansys/hps/client/rms/__init__.py | 2 +- src/ansys/hps/client/rms/api/__init__.py | 23 +++ 15 files changed, 189 insertions(+), 232 deletions(-) create mode 100644 src/ansys/hps/client/rms/api/__init__.py diff --git a/.gitignore b/.gitignore index b3f19e26b..f56c6b48d 100644 --- a/.gitignore +++ b/.gitignore @@ -164,4 +164,5 @@ test_results*.xml mapdl_motorbike_frame.zip examples/mapdl_motorbike_frame/task_input_file* build_info.* -doc/source/api/ansys \ No newline at end of file +doc/source/api/ansys +doc/source/api/_autosummary \ No newline at end of file diff --git a/doc/source/api/auth.rst b/doc/source/api/auth.rst index 61dcc5070..8092215e1 100644 --- a/doc/source/api/auth.rst +++ b/doc/source/api/auth.rst @@ -16,11 +16,20 @@ Authentication function Auth API -------- -.. autoclass:: ansys.hps.client.auth.AuthApi - :members: +.. module:: ansys.hps.client.auth.api -User ----- -.. autoclass:: ansys.hps.client.auth.User - :members: \ No newline at end of file +.. autosummary:: + :toctree: _autosummary + + AuthApi + +Resources +--------- + +.. module:: ansys.hps.client.auth + +.. autosummary:: + :toctree: _autosummary + + User \ No newline at end of file diff --git a/doc/source/api/client.rst b/doc/source/api/client.rst index 5db948005..351e1a007 100644 --- a/doc/source/api/client.rst +++ b/doc/source/api/client.rst @@ -1,14 +1,18 @@ - Client =========================== Connection module ------------------------------------------ -.. automodule:: ansys.hps.client.connection - :members: +.. module:: ansys.hps.client.connection + +.. autosummary:: + :toctree: _autosummary + + create_session + ping Client object ------------------------------------ -.. autoclass:: ansys.hps.client.Client +.. autoclass:: ansys.hps.client.client.Client :members: \ No newline at end of file diff --git a/doc/source/api/exceptions.rst b/doc/source/api/exceptions.rst index 177257256..b66830b98 100644 --- a/doc/source/api/exceptions.rst +++ b/doc/source/api/exceptions.rst @@ -11,8 +11,11 @@ HTTP requests returning an unsuccessful status code raise one of these exception All exceptions that a PyHPS client explicitly raises are inherited from the :exc:`ansys.hps.client.HPSError` base class. -.. autoexception:: ansys.hps.client.HPSError - :members: - -.. autoexception:: ansys.hps.client.APIError -.. autoexception:: ansys.hps.client.ClientError \ No newline at end of file +.. module:: ansys.hps.client.exceptions + +.. autosummary:: + :toctree: _autosummary + + HPSError + APIError + ClientError \ No newline at end of file diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst index 139a57e06..881431472 100644 --- a/doc/source/api/index.rst +++ b/doc/source/api/index.rst @@ -7,7 +7,7 @@ This section describes PyHPS functions, classes, methods, and their parameters a so that you can understand how to interact with them programmatically. .. toctree:: - :maxdepth: 3 + :maxdepth: 2 client auth diff --git a/doc/source/api/jms.rst b/doc/source/api/jms.rst index d9df05f38..2e7c4213d 100644 --- a/doc/source/api/jms.rst +++ b/doc/source/api/jms.rst @@ -10,139 +10,44 @@ which is available at ``https://hostname:port/hps/jms/api``. APIs ---- -JMS API -^^^^^^^ -.. autoclass:: ansys.hps.client.jms.JmsApi - :members: - :undoc-members: +.. module:: ansys.hps.client.jms.api -Project API -^^^^^^^^^^^ -.. autoclass:: ansys.hps.client.jms.ProjectApi - :members: - :undoc-members: +.. autosummary:: + :toctree: _autosummary + JmsApi + ProjectApi Resources --------- -File -^^^^ - -.. autoclass:: ansys.hps.client.jms.File - :members: - -Project -^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.Project - :members: - :undoc-members: - :exclude-members: Meta - -Fitness definition -^^^^^^^^^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.FitnessTermDefinition - :members: - -.. autoclass:: ansys.hps.client.jms.FitnessDefinition - :members: - - -Parameters -^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.FloatParameterDefinition - :members: - -.. autoclass:: ansys.hps.client.jms.BoolParameterDefinition - :members: - -.. autoclass:: ansys.hps.client.jms.IntParameterDefinition - :members: - -.. autoclass:: ansys.hps.client.jms.StringParameterDefinition - :members: - -.. autoclass:: ansys.hps.client.jms.ParameterMapping - :members: - -Task definition -^^^^^^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.Software - :members: - -.. autoclass:: ansys.hps.client.jms.ResourceRequirements - :members: - -.. autoclass:: ansys.hps.client.jms.SuccessCriteria - :members: - -.. autoclass:: ansys.hps.client.jms.Licensing - :members: - -.. autoclass:: ansys.hps.client.jms.TaskDefinition - :members: - - -Job definition -^^^^^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.JobDefinition - :members: - :undoc-members: - :exclude-members: Meta - -Task -^^^^ - -.. autoclass:: ansys.hps.client.jms.Task - :members: - - -Job -^^^ - -.. autoclass:: ansys.hps.client.jms.Job - :members: - - -Job selection -^^^^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.JobSelection - :members: - - -Design exploration algorithm -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.Algorithm - :members: - - -Task definition template -^^^^^^^^^^^^^^^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.TemplateProperty - :members: - -.. autoclass:: ansys.hps.client.jms.TemplateResourceRequirements - :members: - -.. autoclass:: ansys.hps.client.jms.TemplateInputFile - :members: - -.. autoclass:: ansys.hps.client.jms.TemplateOutputFile - :members: - -.. autoclass:: ansys.hps.client.jms.TaskDefinitionTemplate - :members: - -Permissions -^^^^^^^^^^^ - -.. autoclass:: ansys.hps.client.jms.Permission - :members: \ No newline at end of file +.. module:: ansys.hps.client.jms + +.. autosummary:: + :toctree: _autosummary + + File + Project + FitnessTermDefinition + FitnessDefinition + FloatParameterDefinition + BoolParameterDefinition + IntParameterDefinition + StringParameterDefinition + ParameterMapping + Software + ResourceRequirements + SuccessCriteria + Licensing + TaskDefinition + JobDefinition + Task + Job + JobSelection + Algorithm + TemplateProperty + TemplateResourceRequirements + TemplateInputFile + TemplateOutputFile + TaskDefinitionTemplate + Permission diff --git a/doc/source/api/rms.rst b/doc/source/api/rms.rst index 0199e8d84..a51dac251 100644 --- a/doc/source/api/rms.rst +++ b/doc/source/api/rms.rst @@ -10,66 +10,78 @@ is available at ``https://hostname:port/hps/rms/api``. APIs ---- -RMS API -^^^^^^^ -.. autoclass:: ansys.hps.client.rms.RmsApi - :members: - :undoc-members: +.. module:: ansys.hps.client.rms.api +.. autosummary:: + :toctree: _autosummary + + RmsApi Resources --------- -Evaluator registration -^^^^^^^^^^^^^^^^^^^^^^ +.. module:: ansys.hps.client.rms + +.. autosummary:: + :toctree: _autosummary + + EvaluatorRegistration + EvaluatorConfiguration + EvaluatorConfigurationUpdate + ScalerRegistration + ComputeResourceSet + ClusterInfo + +.. Evaluator registration +.. ^^^^^^^^^^^^^^^^^^^^^^ -.. autopydantic_model:: ansys.hps.client.rms.EvaluatorRegistration - :model-show-json: False - :model-show-config-summary: False - :model-show-validator-members: False - :model-show-validator-summary: False - -Evaluator configuration -^^^^^^^^^^^^^^^^^^^^^^^ +.. .. autopydantic_model:: ansys.hps.client.rms.EvaluatorRegistration +.. :model-show-json: False +.. :model-show-config-summary: False +.. :model-show-validator-members: False +.. :model-show-validator-summary: False + +.. Evaluator configuration +.. ^^^^^^^^^^^^^^^^^^^^^^^ -.. autopydantic_model:: ansys.hps.client.rms.EvaluatorConfiguration - :model-show-json: False - :model-show-config-summary: False - :model-show-validator-members: False - :model-show-validator-summary: False - -Evaluator configuration update -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. .. autopydantic_model:: ansys.hps.client.rms.EvaluatorConfiguration +.. :model-show-json: False +.. :model-show-config-summary: False +.. :model-show-validator-members: False +.. :model-show-validator-summary: False + +.. Evaluator configuration update +.. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. autopydantic_model:: ansys.hps.client.rms.EvaluatorConfigurationUpdate - :model-show-json: False - :model-show-config-summary: False - :model-show-validator-members: False - :model-show-validator-summary: False - -Scaler configuration -^^^^^^^^^^^^^^^^^^^^ +.. .. autopydantic_model:: ansys.hps.client.rms.EvaluatorConfigurationUpdate +.. :model-show-json: False +.. :model-show-config-summary: False +.. :model-show-validator-members: False +.. :model-show-validator-summary: False + +.. Scaler configuration +.. ^^^^^^^^^^^^^^^^^^^^ -.. autopydantic_model:: ansys.hps.client.rms.ScalerRegistration - :model-show-json: False - :model-show-config-summary: False - :model-show-validator-members: False - :model-show-validator-summary: False - -Compute resource set -^^^^^^^^^^^^^^^^^^^^ +.. .. autopydantic_model:: ansys.hps.client.rms.ScalerRegistration +.. :model-show-json: False +.. :model-show-config-summary: False +.. :model-show-validator-members: False +.. :model-show-validator-summary: False + +.. Compute resource set +.. ^^^^^^^^^^^^^^^^^^^^ -.. autopydantic_model:: ansys.hps.client.rms.ComputeResourceSet - :model-show-json: False - :model-show-config-summary: False - :model-show-validator-members: False - :model-show-validator-summary: False - -Cluster info -^^^^^^^^^^^^^^^^^^^^ +.. .. autopydantic_model:: ansys.hps.client.rms.ComputeResourceSet +.. :model-show-json: False +.. :model-show-config-summary: False +.. :model-show-validator-members: False +.. :model-show-validator-summary: False + +.. Cluster info +.. ^^^^^^^^^^^^^^^^^^^^ -.. autopydantic_model:: ansys.hps.client.rms.ClusterInfo - :model-show-json: False - :model-show-config-summary: False - :model-show-validator-members: False - :model-show-validator-summary: False +.. .. autopydantic_model:: ansys.hps.client.rms.ClusterInfo +.. :model-show-json: False +.. :model-show-config-summary: False +.. :model-show-validator-members: False +.. :model-show-validator-summary: False diff --git a/doc/source/conf.py b/doc/source/conf.py index 2dc910dba..4c39b1c3c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -292,12 +292,9 @@ def prepare_jinja_env(jinja_env) -> None: # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False -global_substitutions = { - "client_version": __version__, - "version_no_dots": __version__.replace(".", ""), - "external_version": __ansys_apps_version__, - "ansys_version": __ansys_apps_version__, -} +rst_prolog = f""" +.. |ansys_version| replace:: {__ansys_apps_version__} +""" # numpydoc configuration numpydoc_show_class_members = False diff --git a/doc/source/user_guide/dcs_migration.rst b/doc/source/user_guide/dcs_migration.rst index c8787a751..6c3ded7aa 100644 --- a/doc/source/user_guide/dcs_migration.rst +++ b/doc/source/user_guide/dcs_migration.rst @@ -2,7 +2,7 @@ Migration of DCS Python client scripts ====================================== Just as HPS is the successor to DCS (Distributed Compute Services), PyHPS is the successor to the DCS Python client. -For more information, see the latest `DCS Python Client documentation `_. +For more information, see the latest `DCS Python Client documentation `__. Key terminology and API changes @@ -197,7 +197,7 @@ Example project This example shows how to migrate a script that creates a DCS project consisting of an Ansys APDL beam model of a tubular motorbike-frame. -The script was originally included in the `DCS Python Client documentation `_ +The script was originally included in the `DCS Python Client documentation `__ and is now available as a PyHPS script in the :ref:`example_mapdl_motorbike_frame` example. Import modules and instantiate the client diff --git a/examples/lsdyna_cylinder_plate/.gitignore b/examples/lsdyna_cylinder_plate/.gitignore index 6dd154a22..d7a1a5d33 100644 --- a/examples/lsdyna_cylinder_plate/.gitignore +++ b/examples/lsdyna_cylinder_plate/.gitignore @@ -1,2 +1,2 @@ job_results/ -rep_job.json \ No newline at end of file +hps_job.json \ No newline at end of file diff --git a/src/ansys/hps/client/exceptions.py b/src/ansys/hps/client/exceptions.py index bc3ce3d3a..194112028 100644 --- a/src/ansys/hps/client/exceptions.py +++ b/src/ansys/hps/client/exceptions.py @@ -25,38 +25,41 @@ class HPSError(RequestException): + """Provides the base class for all HPS-related errors. + + This class derives from the :class:`requests.exceptions.RequestException` + base class. + + Example: + >>> from ansys.hps.client import HPSError + >>> from ansys.hps.client.jms import Client + >>> try: + >>> client = Client(url="https://127.0.0.1:8443/hps/", + username="repuser", + password="wrong_psw") + >>> except HPSError as e: + >>> print(e) + 401 Client Error: invalid_grant for: POST https://127.0.0.1:8443/hps/auth... + Invalid user credentials + """ + def __init__(self, *args, **kwargs): - """Provides the base class for all HPS-related errors. - - This class derives from the :class:`requests.exceptions.RequestException` - base class. - - Example: - >>> from ansys.hps.client import HPSError - >>> from ansys.hps.client.jms import Client - >>> try: - >>> client = Client(url="https://127.0.0.1:8443/hps/", - username="repuser", - password="wrong_psw") - >>> except HPSError as e: - >>> print(e) - 401 Client Error: invalid_grant for: POST https://127.0.0.1:8443/hps/auth... - Invalid user credentials - """ self.reason = kwargs.pop("reason", None) self.description = kwargs.pop("description", None) super(HPSError, self).__init__(*args, **kwargs) class APIError(HPSError): + """Provides server-side related errors.""" + def __init__(self, *args, **kwargs): - """Provides server-side related errors.""" super(APIError, self).__init__(*args, **kwargs) class ClientError(HPSError): + """Provides client-side related errors.""" + def __init__(self, *args, **kwargs): - """Provides client-side related errors.""" super(ClientError, self).__init__(*args, **kwargs) diff --git a/src/ansys/hps/client/jms/api/jms_api.py b/src/ansys/hps/client/jms/api/jms_api.py index f64073802..8e2fa850e 100644 --- a/src/ansys/hps/client/jms/api/jms_api.py +++ b/src/ansys/hps/client/jms/api/jms_api.py @@ -60,7 +60,7 @@ class JmsApi(object): ... url="https://127.0.0.1:8443/hps", username="repuser", password="repuser" ... ) >>> jms_api = JmsApi(cl) - >>> project = jms_api.create_project(Project(name="Example Project")) + >>> project = jms_api.create_project(Project(name="Example project")) """ diff --git a/src/ansys/hps/client/jms/api/project_api.py b/src/ansys/hps/client/jms/api/project_api.py index 718088541..2ee353a04 100644 --- a/src/ansys/hps/client/jms/api/project_api.py +++ b/src/ansys/hps/client/jms/api/project_api.py @@ -71,17 +71,17 @@ class ProjectApi: >>> cl = Client( ... url="https://127.0.0.1:8443/hps", username="repuser", password="repuser" ... ) - >>> project = Project(name="Example Project") + >>> project = Project(name="Example project") >>> print(project) { - "name": "Example Project" + "name": "Example project" } >>> jms_api = JmsApi(cl) >>> project = jms_api.create_project(project) >>> print(project) { "id": "02qtyJfpfAQ0fr3zkoIAfC", - "name": "Example Project", + "name": "Example project", "active": false, "priority": 1, "creation_time": ... diff --git a/src/ansys/hps/client/rms/__init__.py b/src/ansys/hps/client/rms/__init__.py index a4fda3758..09c9ea160 100644 --- a/src/ansys/hps/client/rms/__init__.py +++ b/src/ansys/hps/client/rms/__init__.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. """PyHPS RMS subpackage.""" -from .api.rms_api import RmsApi +from .api import RmsApi from .models import ( ClusterInfo, ComputeResourceSet, diff --git a/src/ansys/hps/client/rms/api/__init__.py b/src/ansys/hps/client/rms/api/__init__.py new file mode 100644 index 000000000..23bfabf11 --- /dev/null +++ b/src/ansys/hps/client/rms/api/__init__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2024 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. +"""PyHPS RMS API submodule.""" +from .rms_api import RmsApi From 530a4dcb9569f5641a114327f040aa7ade65ac69 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:02:28 +0100 Subject: [PATCH 3/5] Update Makefile - remove sphinx-autoapi --- doc/Makefile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 6b2d948a3..a676dbd6f 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -13,26 +13,18 @@ help: .PHONY: help Makefile -# Install dependencies for sphinx-autoapi -.install-deps: - @pip freeze | grep -q "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi" && is_custom_sphinx_autoapi_installed="yes" || is_custom_sphinx_autoapi_installed="no" - @if [ "$$is_custom_sphinx_autoapi_installed" != "yes" ]; then \ - pip uninstall --yes sphinx-autoapi; \ - pip install "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-stable"; \ - fi - # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: .install-deps Makefile +%: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -pdf: .install-deps +pdf: @$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true (test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1 # Customized clean due to examples gallery -clean: .install-deps +clean: rm -rf $(BUILDDIR)/* rm -rf $(SOURCEDIR)/examples find . -type d -name "_autosummary" -exec rm -rf {} + From be0dc56df4e4098a56c6f88f77b763facf5a84de Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:03:07 +0100 Subject: [PATCH 4/5] Update make.bat - remove sphinx-autoapi --- doc/make.bat | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/make.bat b/doc/make.bat index e64ac6b3d..c98a36031 100644 --- a/doc/make.bat +++ b/doc/make.bat @@ -10,13 +10,6 @@ if "%SPHINXBUILD%" == "" ( set SOURCEDIR=source set BUILDDIR=_build -REM TODO: these lines of code should be removed once the feature branch is merged -for /f %%i in ('pip freeze ^| findstr /c:"sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi"') do set is_custom_sphinx_autoapi_installed=%%i -if NOT "%is_custom_sphinx_autoapi_installed%" == "sphinx-autoapi" ( - pip uninstall --yes sphinx-autoapi - pip install "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-stable") -REM TODO: these lines of code should be removed once the feature branch is merged - if "%1" == "" goto help if "%1" == "clean" goto clean From 92dbfd471a1609b57aad320cf6e4f630c590276b Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Mon, 12 Feb 2024 10:30:20 +0100 Subject: [PATCH 5/5] remove sphinx-autoapi dep --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7ae7861d6..9612116be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,6 @@ doc = [ "numpydoc==1.6.0", "myst-parser==2.0.0", "Sphinx==7.2.6", - "sphinx-autoapi==3.0.0", "sphinx-autodoc-typehints==1.25.3", "sphinxcontrib-globalsubs==0.1.1", "sphinxcontrib-httpdomain==1.8.1",