From fe2086a3ffe0bce3e4d1af5bbca9924b16d28cac Mon Sep 17 00:00:00 2001 From: JackB-Ansys Date: Mon, 4 Dec 2023 11:49:07 +0000 Subject: [PATCH 1/7] Updated documentation: New 'Utility functions' descriptions for previously hidden functions. Added Adaptive geometry and utility functions to the API reference page. --- doc/source/methods/geometry_functions.rst | 5 ++++- doc/source/methods/index.rst | 15 +++++++++++++++ doc/source/methods/utility_functions.rst | 15 +++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 doc/source/methods/utility_functions.rst diff --git a/doc/source/methods/geometry_functions.rst b/doc/source/methods/geometry_functions.rst index 222362d4d..3ae4d4fe2 100644 --- a/doc/source/methods/geometry_functions.rst +++ b/doc/source/methods/geometry_functions.rst @@ -1,6 +1,9 @@ -.. currentmodule:: ansys.motorcad.core.geometry +.. _ref_geometry_functions: Adaptive geometry ================= + +.. currentmodule:: ansys.motorcad.core.geometry + Add some info here about adaptive geometry diff --git a/doc/source/methods/index.rst b/doc/source/methods/index.rst index b248cc760..5aa88d7f3 100644 --- a/doc/source/methods/index.rst +++ b/doc/source/methods/index.rst @@ -23,6 +23,20 @@ object, its single class, and its many methods, see In addition to giving the available methods, their replacement functions have been commented. +Adaptive geometry +------------------ + +Adaptive geometry can be used to set up custom geometries in Motor-CAD. +For descriptions of adaptive geometry objects and functions, see +:ref:`ref_geometry_functions`. + +Utility functions +------------------ + +A number of utility functions are available to the user. +For descriptions, see +:ref:`ref_utility_functions`. + .. toctree:: :maxdepth: 1 :hidden: @@ -30,3 +44,4 @@ object, its single class, and its many methods, see MotorCAD_object MotorCADCompatibility_object geometry_functions + utility_functions diff --git a/doc/source/methods/utility_functions.rst b/doc/source/methods/utility_functions.rst new file mode 100644 index 000000000..ea7210977 --- /dev/null +++ b/doc/source/methods/utility_functions.rst @@ -0,0 +1,15 @@ +.. _ref_utility_functions: + +Utility functions +================== + +.. currentmodule:: ansys.motorcad.core.rpc_client_core + + +.. autosummary:: + :toctree: _autosummary_utility_functions + + MotorCADError + set_default_instance + set_motorcad_exe + set_server_ip \ No newline at end of file From 614e1b9cbdf50605c98ff177f98de4980ead9c22 Mon Sep 17 00:00:00 2001 From: JackB-Ansys Date: Thu, 11 Jan 2024 10:38:12 +0000 Subject: [PATCH 2/7] Moved MotorCADError to its own section in API docs --- doc/source/methods/MotorCAD_errors.rst | 12 ++++++++++++ doc/source/methods/index.rst | 8 ++++++++ doc/source/methods/utility_functions.rst | 1 - 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 doc/source/methods/MotorCAD_errors.rst diff --git a/doc/source/methods/MotorCAD_errors.rst b/doc/source/methods/MotorCAD_errors.rst new file mode 100644 index 000000000..e7a9a4319 --- /dev/null +++ b/doc/source/methods/MotorCAD_errors.rst @@ -0,0 +1,12 @@ +.. _ref_MotorCAD_errors: + +Motor-CAD Errors +================ + +.. currentmodule:: ansys.motorcad.core.rpc_client_core + + +.. autosummary:: + :toctree: _autosummary_MotorCAD_errors + + MotorCADError \ No newline at end of file diff --git a/doc/source/methods/index.rst b/doc/source/methods/index.rst index 5aa88d7f3..5a8f2c521 100644 --- a/doc/source/methods/index.rst +++ b/doc/source/methods/index.rst @@ -37,6 +37,13 @@ A number of utility functions are available to the user. For descriptions, see :ref:`ref_utility_functions`. +Motor-CAD Errors +---------------- + +A class/exception type used for obtaining and handling errors from Motor-CAD. +For descriptions, see +:ref:`MotorCAD_errors`. + .. toctree:: :maxdepth: 1 :hidden: @@ -45,3 +52,4 @@ For descriptions, see MotorCADCompatibility_object geometry_functions utility_functions + MotorCAD_errors diff --git a/doc/source/methods/utility_functions.rst b/doc/source/methods/utility_functions.rst index ea7210977..0bd55639b 100644 --- a/doc/source/methods/utility_functions.rst +++ b/doc/source/methods/utility_functions.rst @@ -9,7 +9,6 @@ Utility functions .. autosummary:: :toctree: _autosummary_utility_functions - MotorCADError set_default_instance set_motorcad_exe set_server_ip \ No newline at end of file From b61186717edcb3ba125fd8c5ab2b6121eda68b0a Mon Sep 17 00:00:00 2001 From: JackB-Ansys Date: Tue, 7 May 2024 10:11:13 +0100 Subject: [PATCH 3/7] Merged from main and improved Docstrings --- src/ansys/motorcad/core/rpc_client_core.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/ansys/motorcad/core/rpc_client_core.py b/src/ansys/motorcad/core/rpc_client_core.py index 61bd9224f..cd18bb6af 100644 --- a/src/ansys/motorcad/core/rpc_client_core.py +++ b/src/ansys/motorcad/core/rpc_client_core.py @@ -44,7 +44,13 @@ def is_running_in_internal_scripting(): def set_server_ip(ip): - """IP address of the machine that Motor-CAD is running on.""" + """Set the IP address of the machine that Motor-CAD is running on. + + Parameters + ---------- + ip : str + IP address of the machine that Motor-CAD is running on. + """ global SERVER_IP SERVER_IP = ip @@ -53,13 +59,24 @@ def set_default_instance(port): """Set the Motor-CAD instance to use as the default when running scripts from MotorCAD. For Motor-CAD internal use only. Do not use this function. + + Parameters + ---------- + port : int + Port number of the Motor-CAD instance to be set as default. """ global DEFAULT_INSTANCE DEFAULT_INSTANCE = port def set_motorcad_exe(exe_location): - """Set the directory with the Motor-CAD executable file to launch.""" + """Set the directory with the Motor-CAD executable file to launch. + + Parameters + ---------- + exe_location : str + Directory of the Motor-CAD executable file to launch. + """ global MOTORCAD_EXE_GLOBAL MOTORCAD_EXE_GLOBAL = exe_location From 256404212d94e606e6bdde71624ec82369692c95 Mon Sep 17 00:00:00 2001 From: Jack <106958177+JackB-Ansys@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:22:42 +0100 Subject: [PATCH 4/7] Update src/ansys/motorcad/core/rpc_client_core.py Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- src/ansys/motorcad/core/rpc_client_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/motorcad/core/rpc_client_core.py b/src/ansys/motorcad/core/rpc_client_core.py index cd18bb6af..1481a50f0 100644 --- a/src/ansys/motorcad/core/rpc_client_core.py +++ b/src/ansys/motorcad/core/rpc_client_core.py @@ -63,7 +63,7 @@ def set_default_instance(port): Parameters ---------- port : int - Port number of the Motor-CAD instance to be set as default. + Port number of the Motor-CAD instance to set as the default. """ global DEFAULT_INSTANCE DEFAULT_INSTANCE = port From be3d53f799f9c0b198203a1de65c37c2bf340428 Mon Sep 17 00:00:00 2001 From: Jack <106958177+JackB-Ansys@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:22:58 +0100 Subject: [PATCH 5/7] Update doc/source/methods/MotorCAD_errors.rst Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/methods/MotorCAD_errors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/methods/MotorCAD_errors.rst b/doc/source/methods/MotorCAD_errors.rst index e7a9a4319..2355af8dc 100644 --- a/doc/source/methods/MotorCAD_errors.rst +++ b/doc/source/methods/MotorCAD_errors.rst @@ -1,6 +1,6 @@ .. _ref_MotorCAD_errors: -Motor-CAD Errors +Motor-CAD errors ================ .. currentmodule:: ansys.motorcad.core.rpc_client_core From f313ad1046c6439753b090192e13b53a6f8f443d Mon Sep 17 00:00:00 2001 From: Jack <106958177+JackB-Ansys@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:23:20 +0100 Subject: [PATCH 6/7] Update doc/source/methods/index.rst Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/methods/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/methods/index.rst b/doc/source/methods/index.rst index cfaa43e7b..6db7b2a0b 100644 --- a/doc/source/methods/index.rst +++ b/doc/source/methods/index.rst @@ -43,8 +43,8 @@ For descriptions of the functions, see :ref:`ref_geometry_shapes`. Utility functions ------------------ -A number of utility functions are available to the user. -For descriptions, see +A number of utility functions are available. +For more information, see :ref:`ref_utility_functions`. Motor-CAD Errors From 4675a9551e51fc13e64ef6f11c027b2fdeac77a9 Mon Sep 17 00:00:00 2001 From: Jack <106958177+JackB-Ansys@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:23:31 +0100 Subject: [PATCH 7/7] Update doc/source/methods/index.rst Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/methods/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/methods/index.rst b/doc/source/methods/index.rst index 6db7b2a0b..ba6faeab3 100644 --- a/doc/source/methods/index.rst +++ b/doc/source/methods/index.rst @@ -47,7 +47,7 @@ A number of utility functions are available. For more information, see :ref:`ref_utility_functions`. -Motor-CAD Errors +Motor-CAD errors ---------------- A class/exception type used for obtaining and handling errors from Motor-CAD.