ansys-mechanical-core 0.11.11__tar.gz → 0.11.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/PKG-INFO +42 -29
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/README.rst +21 -12
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/pyproject.toml +24 -17
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/_version.py +1 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/app.py +2 -3
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/background.py +11 -2
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/enum_importer.py +1 -1
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/imports.py +2 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/initializer.py +6 -1
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/logger/__init__.py +1 -1
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/poster.py +33 -1
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/resolver.py +12 -5
- ansys_mechanical_core-0.11.13/src/ansys/mechanical/core/embedding/rpc/__init__.py +36 -0
- ansys_mechanical_core-0.11.13/src/ansys/mechanical/core/embedding/rpc/client.py +237 -0
- ansys_mechanical_core-0.11.13/src/ansys/mechanical/core/embedding/rpc/server.py +382 -0
- ansys_mechanical_core-0.11.13/src/ansys/mechanical/core/embedding/rpc/utils.py +120 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/runtime.py +22 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/feature_flags.py +1 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/ide_config.py +5 -5
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/mechanical.py +34 -15
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/misc.py +2 -2
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/pool.py +8 -8
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/run.py +3 -3
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/LICENSE +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/__init__.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/__init__.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/addins.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/app_libraries.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/appdata.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/cleanup_gui.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/loader.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/logger/environ.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/logger/linux_api.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/logger/sinks.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/logger/windows_api.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/shims.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/ui.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/utils.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/viz/__init__.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/viz/embedding_plotter.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/viz/usd_converter.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/viz/utils.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/embedding/warnings.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/errors.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/examples/__init__.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/examples/downloads.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/launcher.py +0 -0
- {ansys_mechanical_core-0.11.11 → ansys_mechanical_core-0.11.13}/src/ansys/mechanical/core/logging.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: ansys-mechanical-core
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.13
|
4
4
|
Summary: A python wrapper for Ansys Mechanical
|
5
5
|
Keywords: pymechanical,mechanical,ansys,pyansys
|
6
6
|
Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
|
@@ -17,44 +17,46 @@ Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: License :: OSI Approved :: MIT License
|
18
18
|
Classifier: Operating System :: OS Independent
|
19
19
|
Requires-Dist: ansys-api-mechanical==0.1.2
|
20
|
-
Requires-Dist: ansys-mechanical-env==0.1.
|
21
|
-
Requires-Dist: ansys-mechanical-stubs==0.1.
|
22
|
-
Requires-Dist: ansys-
|
23
|
-
Requires-Dist: ansys-pythonnet>=3.1.0rc2
|
20
|
+
Requires-Dist: ansys-mechanical-env==0.1.9
|
21
|
+
Requires-Dist: ansys-mechanical-stubs==0.1.6
|
22
|
+
Requires-Dist: ansys-pythonnet>=3.1.0rc6
|
24
23
|
Requires-Dist: ansys-tools-path>=0.3.1
|
25
24
|
Requires-Dist: appdirs>=1.4.0
|
26
25
|
Requires-Dist: click>=8.1.3
|
27
|
-
Requires-Dist: clr-loader
|
26
|
+
Requires-Dist: clr-loader>=0.2.6
|
28
27
|
Requires-Dist: grpcio>=1.30.0
|
29
28
|
Requires-Dist: protobuf>=3.12.2,<6
|
30
|
-
Requires-Dist: psutil
|
29
|
+
Requires-Dist: psutil>=6
|
31
30
|
Requires-Dist: tqdm>=4.45.0
|
32
31
|
Requires-Dist: requests>=2,<3
|
33
32
|
Requires-Dist: sphinx==8.1.3 ; extra == "doc"
|
34
|
-
Requires-Dist: ansys-sphinx-theme[autoapi]==1.
|
35
|
-
Requires-Dist: grpcio==1.
|
36
|
-
Requires-Dist: imageio-ffmpeg==0.
|
37
|
-
Requires-Dist: imageio==2.
|
33
|
+
Requires-Dist: ansys-sphinx-theme[autoapi, changelog]==1.3.1 ; extra == "doc"
|
34
|
+
Requires-Dist: grpcio==1.70.0 ; extra == "doc"
|
35
|
+
Requires-Dist: imageio-ffmpeg==0.6.0 ; extra == "doc"
|
36
|
+
Requires-Dist: imageio==2.37.0 ; extra == "doc"
|
38
37
|
Requires-Dist: jupyter_sphinx==0.5.3 ; extra == "doc"
|
39
38
|
Requires-Dist: jupyterlab>=3.2.8 ; extra == "doc"
|
40
39
|
Requires-Dist: matplotlib==3.10.0 ; extra == "doc"
|
41
|
-
Requires-Dist: numpy==2.2.
|
40
|
+
Requires-Dist: numpy==2.2.2 ; extra == "doc"
|
42
41
|
Requires-Dist: numpydoc==1.8.0 ; extra == "doc"
|
43
42
|
Requires-Dist: pandas==2.2.3 ; extra == "doc"
|
44
|
-
Requires-Dist: panel==1.
|
45
|
-
Requires-Dist: plotly==
|
46
|
-
Requires-Dist: pypandoc==1.
|
43
|
+
Requires-Dist: panel==1.6.0 ; extra == "doc"
|
44
|
+
Requires-Dist: plotly==6.0.0 ; extra == "doc"
|
45
|
+
Requires-Dist: pypandoc==1.15 ; extra == "doc"
|
47
46
|
Requires-Dist: pytest-sphinx==0.6.3 ; extra == "doc"
|
48
47
|
Requires-Dist: pythreejs==2.4.2 ; extra == "doc"
|
49
48
|
Requires-Dist: pyvista>=0.39.1 ; extra == "doc"
|
50
49
|
Requires-Dist: sphinx-autobuild==2024.10.3 ; extra == "doc"
|
51
|
-
Requires-Dist: sphinx-autodoc-typehints==3.0.
|
50
|
+
Requires-Dist: sphinx-autodoc-typehints==3.0.1 ; extra == "doc"
|
52
51
|
Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "doc"
|
53
52
|
Requires-Dist: sphinx_design==0.6.1 ; extra == "doc"
|
54
53
|
Requires-Dist: sphinx-gallery==0.18.0 ; extra == "doc"
|
55
|
-
Requires-Dist: sphinx-notfound-page==1.0
|
54
|
+
Requires-Dist: sphinx-notfound-page==1.1.0 ; extra == "doc"
|
56
55
|
Requires-Dist: sphinxcontrib-websupport==2.0.0 ; extra == "doc"
|
57
56
|
Requires-Dist: sphinxemoji==0.3.1 ; extra == "doc"
|
57
|
+
Requires-Dist: ansys-platform-instancemanagement>=1.0.1 ; extra == "pim"
|
58
|
+
Requires-Dist: rpyc==6.0.1 ; extra == "rpc"
|
59
|
+
Requires-Dist: toolz==1.0.0 ; extra == "rpc"
|
58
60
|
Requires-Dist: pytest==8.3.4 ; extra == "tests"
|
59
61
|
Requires-Dist: pytest-cov==6.0.0 ; extra == "tests"
|
60
62
|
Requires-Dist: pytest-print==1.0.2 ; extra == "tests"
|
@@ -67,6 +69,8 @@ Project-URL: Homepage, https://github.com/ansys/pymechanical
|
|
67
69
|
Project-URL: Issues, https://github.com/ansys/pymechanical/issues
|
68
70
|
Project-URL: Repository, https://github.com/ansys/pymechanical
|
69
71
|
Provides-Extra: doc
|
72
|
+
Provides-Extra: pim
|
73
|
+
Provides-Extra: rpc
|
70
74
|
Provides-Extra: tests
|
71
75
|
Provides-Extra: viz
|
72
76
|
|
@@ -141,16 +145,17 @@ session must be reachable from your Python program.
|
|
141
145
|
Getting started
|
142
146
|
---------------
|
143
147
|
|
148
|
+
.. _scripting_guide: https://ansyshelp.ansys.com/Views/Secured/corp/v251/en/act_script/act_script.html
|
149
|
+
|
144
150
|
PyMechanical uses the built-in scripting capabilities of Mechanical. For information on the
|
145
|
-
scripting APIs available, see the `Scripting in Mechanical Guide
|
146
|
-
<https://ansyshelp.ansys.com/Views/Secured/corp/v242/en/act_script/act_script.html>`_ in the
|
151
|
+
scripting APIs available, see the `Scripting in Mechanical Guide <_scripting_guide>`_ in the
|
147
152
|
Ansys Help.
|
148
153
|
|
149
154
|
Configuring the mechanical installation
|
150
155
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
151
156
|
|
152
157
|
On a Windows system, the environment variable ``AWP_ROOT<ver>`` is configured when Mechanical is
|
153
|
-
installed, where ``<ver>`` is the Mechanical release number, such as ``
|
158
|
+
installed, where ``<ver>`` is the Mechanical release number, such as ``251`` for release 2025 R1.
|
154
159
|
PyMechanical automatically uses this environment variable (or variables if there are multiple
|
155
160
|
installations of different versions) to locate the latest Mechanical installation. On a Linux
|
156
161
|
system, you must configure the ``AWP_ROOT<ver>`` environment variable to point to the
|
@@ -195,8 +200,23 @@ on Windows and Linux for version 2023 R2 and later. Here is an example:
|
|
195
200
|
app.update_globals(globals())
|
196
201
|
project_dir = DataModel.Project.ProjectDirectory
|
197
202
|
|
198
|
-
|
199
|
-
|
203
|
+
How to report issues
|
204
|
+
--------------------
|
205
|
+
|
206
|
+
If you encounter any issues or limitations with PyMechanical that hinder your work, please create
|
207
|
+
an issue or discussion so our team can address them promptly:
|
208
|
+
|
209
|
+
* `PyMechanical Issues <https://github.com/ansys/pymechanical/issues>`_: Report bugs and request new features.
|
210
|
+
* `PyMechanical Discussions <https://github.com/ansys/pymechanical/discussions>`_: Post questions, share ideas, and get community feedback.
|
211
|
+
|
212
|
+
For issues pertaining to `Mechanical scripting <https://mechanical.docs.pyansys.com/version/stable/user_guide_scripting/index.html>`_,
|
213
|
+
please make a post on the `Developer Portal <https://forum.ansys.com/categories/structures>`_.
|
214
|
+
|
215
|
+
If you have general questions about PyAnsys or are unsure which repository to place an issue in,
|
216
|
+
email `pyansys.core@ansys.com <pyansys.core@ansys.com>`_.
|
217
|
+
|
218
|
+
Documentation resources
|
219
|
+
-----------------------
|
200
220
|
|
201
221
|
Documentation for the latest stable release of PyMechanical is hosted at `PyMechanical documentation
|
202
222
|
<https://mechanical.docs.pyansys.com/>`_.
|
@@ -210,13 +230,6 @@ You can also `view <https://cheatsheets.docs.pyansys.com/pymechanical_cheat_shee
|
|
210
230
|
PyMechanical cheat sheet. This one-page reference provides syntax rules and commands
|
211
231
|
for using PyMechanical.
|
212
232
|
|
213
|
-
On the `PyMechanical Issues <https://github.com/ansys/pymechanical/issues>`_ page,
|
214
|
-
you can create issues to report bugs and request new features. On the `PyMechanical Discussions
|
215
|
-
<https://github.com/ansys/pymechanical/discussions>`_ page or the `Discussions <https://discuss.ansys.com/>`_
|
216
|
-
page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.
|
217
|
-
|
218
|
-
To reach the project support team, email `pyansys.core@ansys.com <pyansys.core@ansys.com>`_.
|
219
|
-
|
220
233
|
Testing and development
|
221
234
|
-----------------------
|
222
235
|
|
@@ -69,16 +69,17 @@ session must be reachable from your Python program.
|
|
69
69
|
Getting started
|
70
70
|
---------------
|
71
71
|
|
72
|
+
.. _scripting_guide: https://ansyshelp.ansys.com/Views/Secured/corp/v251/en/act_script/act_script.html
|
73
|
+
|
72
74
|
PyMechanical uses the built-in scripting capabilities of Mechanical. For information on the
|
73
|
-
scripting APIs available, see the `Scripting in Mechanical Guide
|
74
|
-
<https://ansyshelp.ansys.com/Views/Secured/corp/v242/en/act_script/act_script.html>`_ in the
|
75
|
+
scripting APIs available, see the `Scripting in Mechanical Guide <_scripting_guide>`_ in the
|
75
76
|
Ansys Help.
|
76
77
|
|
77
78
|
Configuring the mechanical installation
|
78
79
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
79
80
|
|
80
81
|
On a Windows system, the environment variable ``AWP_ROOT<ver>`` is configured when Mechanical is
|
81
|
-
installed, where ``<ver>`` is the Mechanical release number, such as ``
|
82
|
+
installed, where ``<ver>`` is the Mechanical release number, such as ``251`` for release 2025 R1.
|
82
83
|
PyMechanical automatically uses this environment variable (or variables if there are multiple
|
83
84
|
installations of different versions) to locate the latest Mechanical installation. On a Linux
|
84
85
|
system, you must configure the ``AWP_ROOT<ver>`` environment variable to point to the
|
@@ -123,8 +124,23 @@ on Windows and Linux for version 2023 R2 and later. Here is an example:
|
|
123
124
|
app.update_globals(globals())
|
124
125
|
project_dir = DataModel.Project.ProjectDirectory
|
125
126
|
|
126
|
-
|
127
|
-
|
127
|
+
How to report issues
|
128
|
+
--------------------
|
129
|
+
|
130
|
+
If you encounter any issues or limitations with PyMechanical that hinder your work, please create
|
131
|
+
an issue or discussion so our team can address them promptly:
|
132
|
+
|
133
|
+
* `PyMechanical Issues <https://github.com/ansys/pymechanical/issues>`_: Report bugs and request new features.
|
134
|
+
* `PyMechanical Discussions <https://github.com/ansys/pymechanical/discussions>`_: Post questions, share ideas, and get community feedback.
|
135
|
+
|
136
|
+
For issues pertaining to `Mechanical scripting <https://mechanical.docs.pyansys.com/version/stable/user_guide_scripting/index.html>`_,
|
137
|
+
please make a post on the `Developer Portal <https://forum.ansys.com/categories/structures>`_.
|
138
|
+
|
139
|
+
If you have general questions about PyAnsys or are unsure which repository to place an issue in,
|
140
|
+
email `pyansys.core@ansys.com <pyansys.core@ansys.com>`_.
|
141
|
+
|
142
|
+
Documentation resources
|
143
|
+
-----------------------
|
128
144
|
|
129
145
|
Documentation for the latest stable release of PyMechanical is hosted at `PyMechanical documentation
|
130
146
|
<https://mechanical.docs.pyansys.com/>`_.
|
@@ -138,13 +154,6 @@ You can also `view <https://cheatsheets.docs.pyansys.com/pymechanical_cheat_shee
|
|
138
154
|
PyMechanical cheat sheet. This one-page reference provides syntax rules and commands
|
139
155
|
for using PyMechanical.
|
140
156
|
|
141
|
-
On the `PyMechanical Issues <https://github.com/ansys/pymechanical/issues>`_ page,
|
142
|
-
you can create issues to report bugs and request new features. On the `PyMechanical Discussions
|
143
|
-
<https://github.com/ansys/pymechanical/discussions>`_ page or the `Discussions <https://discuss.ansys.com/>`_
|
144
|
-
page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.
|
145
|
-
|
146
|
-
To reach the project support team, email `pyansys.core@ansys.com <pyansys.core@ansys.com>`_.
|
147
|
-
|
148
157
|
Testing and development
|
149
158
|
-----------------------
|
150
159
|
|
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
|
|
5
5
|
[project]
|
6
6
|
# Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
|
7
7
|
name = "ansys-mechanical-core"
|
8
|
-
version = "0.11.
|
8
|
+
version = "0.11.13"
|
9
9
|
description = "A python wrapper for Ansys Mechanical"
|
10
10
|
readme = "README.rst"
|
11
11
|
requires-python = ">=3.10,<4.0"
|
@@ -27,17 +27,16 @@ classifiers = [
|
|
27
27
|
]
|
28
28
|
dependencies = [
|
29
29
|
"ansys-api-mechanical==0.1.2",
|
30
|
-
"ansys-mechanical-env==0.1.
|
31
|
-
"ansys-mechanical-stubs==0.1.
|
32
|
-
"ansys-
|
33
|
-
"ansys-pythonnet>=3.1.0rc2",
|
30
|
+
"ansys-mechanical-env==0.1.9",
|
31
|
+
"ansys-mechanical-stubs==0.1.6",
|
32
|
+
"ansys-pythonnet>=3.1.0rc6",
|
34
33
|
"ansys-tools-path>=0.3.1",
|
35
34
|
"appdirs>=1.4.0",
|
36
35
|
"click>=8.1.3", # for CLI interface
|
37
|
-
"clr-loader
|
36
|
+
"clr-loader>=0.2.6",
|
38
37
|
"grpcio>=1.30.0",
|
39
38
|
"protobuf>=3.12.2,<6",
|
40
|
-
"psutil
|
39
|
+
"psutil>=6",
|
41
40
|
"tqdm>=4.45.0",
|
42
41
|
"requests>=2,<3",
|
43
42
|
]
|
@@ -58,28 +57,28 @@ tests = [
|
|
58
57
|
]
|
59
58
|
doc = [
|
60
59
|
"sphinx==8.1.3",
|
61
|
-
"ansys-sphinx-theme[autoapi]==1.
|
62
|
-
"grpcio==1.
|
63
|
-
"imageio-ffmpeg==0.
|
64
|
-
"imageio==2.
|
60
|
+
"ansys-sphinx-theme[autoapi,changelog]==1.3.1",
|
61
|
+
"grpcio==1.70.0",
|
62
|
+
"imageio-ffmpeg==0.6.0",
|
63
|
+
"imageio==2.37.0",
|
65
64
|
"jupyter_sphinx==0.5.3",
|
66
65
|
"jupyterlab>=3.2.8",
|
67
66
|
"matplotlib==3.10.0",
|
68
|
-
"numpy==2.2.
|
67
|
+
"numpy==2.2.2",
|
69
68
|
"numpydoc==1.8.0",
|
70
69
|
"pandas==2.2.3",
|
71
|
-
"panel==1.
|
72
|
-
"plotly==
|
73
|
-
"pypandoc==1.
|
70
|
+
"panel==1.6.0",
|
71
|
+
"plotly==6.0.0",
|
72
|
+
"pypandoc==1.15",
|
74
73
|
"pytest-sphinx==0.6.3",
|
75
74
|
"pythreejs==2.4.2",
|
76
75
|
"pyvista>=0.39.1",
|
77
76
|
"sphinx-autobuild==2024.10.3",
|
78
|
-
"sphinx-autodoc-typehints==3.0.
|
77
|
+
"sphinx-autodoc-typehints==3.0.1",
|
79
78
|
"sphinx-copybutton==0.5.2",
|
80
79
|
"sphinx_design==0.6.1",
|
81
80
|
"sphinx-gallery==0.18.0",
|
82
|
-
"sphinx-notfound-page==1.0
|
81
|
+
"sphinx-notfound-page==1.1.0",
|
83
82
|
"sphinxcontrib-websupport==2.0.0",
|
84
83
|
"sphinxemoji==0.3.1",
|
85
84
|
]
|
@@ -87,6 +86,13 @@ viz = [
|
|
87
86
|
"ansys-tools-visualization-interface>=0.2.6",
|
88
87
|
"usd-core==24.11",
|
89
88
|
]
|
89
|
+
rpc = [
|
90
|
+
"rpyc==6.0.1",
|
91
|
+
"toolz==1.0.0",
|
92
|
+
]
|
93
|
+
pim = [
|
94
|
+
"ansys-platform-instancemanagement>=1.0.1",
|
95
|
+
]
|
90
96
|
|
91
97
|
[project.scripts]
|
92
98
|
ansys-mechanical = "ansys.mechanical.core.run:cli"
|
@@ -133,6 +139,7 @@ addopts = """-ra -s --durations=0 --cov=ansys.mechanical --cov-report html:.cov/
|
|
133
139
|
# addopts = """-ra -s -m 'remote_session_launch or remote_session_connect or embedding' --durations=0
|
134
140
|
# --cov=ansys.mechanical --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report \
|
135
141
|
# term -vv --print --print-relative-time"""
|
142
|
+
|
136
143
|
testpaths = [
|
137
144
|
"tests",
|
138
145
|
]
|
@@ -134,8 +134,7 @@ class App:
|
|
134
134
|
Create App with Mechanical project file and version:
|
135
135
|
|
136
136
|
>>> from ansys.mechanical.core import App
|
137
|
-
>>> app = App(db_file="path/to/file.mechdat", version=
|
138
|
-
|
137
|
+
>>> app = App(db_file="path/to/file.mechdat", version=251)
|
139
138
|
|
140
139
|
Disable copying the user profile when private appdata is enabled
|
141
140
|
|
@@ -182,8 +181,8 @@ class App:
|
|
182
181
|
profile.update_environment(os.environ)
|
183
182
|
atexit.register(_cleanup_private_appdata, profile)
|
184
183
|
|
185
|
-
self._app = _start_application(configuration, self._version, db_file)
|
186
184
|
runtime.initialize(self._version)
|
185
|
+
self._app = _start_application(configuration, self._version, db_file)
|
187
186
|
connect_warnings(self)
|
188
187
|
self._poster = None
|
189
188
|
|
@@ -76,12 +76,21 @@ class BackgroundApp:
|
|
76
76
|
"""
|
77
77
|
return BackgroundApp.__app
|
78
78
|
|
79
|
-
def
|
80
|
-
"""Post callable method to the background app thread."""
|
79
|
+
def _post(self, callable: typing.Callable, try_post: bool = False):
|
81
80
|
if BackgroundApp.__stopped:
|
82
81
|
raise RuntimeError("Cannot use BackgroundApp after stopping it.")
|
82
|
+
if try_post:
|
83
|
+
return BackgroundApp.__poster.try_post(callable)
|
83
84
|
return BackgroundApp.__poster.post(callable)
|
84
85
|
|
86
|
+
def post(self, callable: typing.Callable):
|
87
|
+
"""Post callable method to the background app thread."""
|
88
|
+
return self._post(callable)
|
89
|
+
|
90
|
+
def try_post(self, callable: typing.Callable):
|
91
|
+
"""Try post callable method to the background app thread."""
|
92
|
+
return self._post(callable, try_post=True)
|
93
|
+
|
85
94
|
def stop(self) -> None:
|
86
95
|
"""Stop the background app thread."""
|
87
96
|
if BackgroundApp.__stopped:
|
@@ -33,5 +33,5 @@ clr.AddReference("Ansys.ACT.Interfaces")
|
|
33
33
|
|
34
34
|
from Ansys.ACT.Interfaces.Common import * # noqa isort: skip
|
35
35
|
from Ansys.Mechanical.DataModel.Enums import * # noqa isort: skip
|
36
|
-
|
36
|
+
from Ansys.ACT.Interfaces.Analysis import * # noqa isort: skip
|
37
37
|
import Ansys # noqa isort: skip
|
@@ -55,6 +55,7 @@ def global_variables(app: "ansys.mechanical.core.App", enums: bool = False) -> t
|
|
55
55
|
# When ansys-pythonnet issue #14 is fixed, uncomment above
|
56
56
|
from Ansys.ACT.Core.Math import Point2D, Point3D
|
57
57
|
from Ansys.ACT.Math import Vector3D
|
58
|
+
from Ansys.ACT.Mechanical.Fields import VariableDefinitionType
|
58
59
|
from Ansys.Core.Units import Quantity
|
59
60
|
from Ansys.Mechanical.DataModel import MechanicalEnums
|
60
61
|
from Ansys.Mechanical.Graphics import Point, SectionPlane
|
@@ -74,6 +75,7 @@ def global_variables(app: "ansys.mechanical.core.App", enums: bool = False) -> t
|
|
74
75
|
vars["Point2D"] = Point2D
|
75
76
|
vars["Point3D"] = Point3D
|
76
77
|
vars["Vector3D"] = Vector3D
|
78
|
+
vars["VariableDefinitionType"] = VariableDefinitionType
|
77
79
|
|
78
80
|
if enums:
|
79
81
|
vars.update(get_all_enums())
|
@@ -34,7 +34,12 @@ from ansys.mechanical.core.embedding.resolver import resolve
|
|
34
34
|
INITIALIZED_VERSION = None
|
35
35
|
"""Constant for the initialized version."""
|
36
36
|
|
37
|
-
SUPPORTED_MECHANICAL_EMBEDDING_VERSIONS = {
|
37
|
+
SUPPORTED_MECHANICAL_EMBEDDING_VERSIONS = {
|
38
|
+
251: "2025R1",
|
39
|
+
242: "2024R2",
|
40
|
+
241: "2024R1",
|
41
|
+
232: "2023R2",
|
42
|
+
}
|
38
43
|
"""Supported Mechanical embedding versions on Windows."""
|
39
44
|
|
40
45
|
|
@@ -37,7 +37,7 @@ Configuring the logger can be done using the :class:`Configuration <ansys.mechan
|
|
37
37
|
from ansys.mechanical.core.embedding.logger import Configuration, Logger
|
38
38
|
|
39
39
|
Configuration.configure(level=logging.INFO, to_stdout=True, base_directory=None)
|
40
|
-
app = mech.App(version=
|
40
|
+
app = mech.App(version=251)
|
41
41
|
|
42
42
|
Then, the :class:`Logger <ansys.mechanical.core.embedding.logger.Logger>` class can be used to write messages to the log:
|
43
43
|
|
@@ -25,6 +25,19 @@
|
|
25
25
|
import typing
|
26
26
|
|
27
27
|
|
28
|
+
class PosterError(Exception):
|
29
|
+
"""Class which holds errors from the background thread posting system."""
|
30
|
+
|
31
|
+
def __init__(self, error: Exception):
|
32
|
+
"""Create an instance to hold the given error."""
|
33
|
+
self._error = error
|
34
|
+
|
35
|
+
@property
|
36
|
+
def error(self) -> Exception:
|
37
|
+
"""Get the underlying exception."""
|
38
|
+
return self._error
|
39
|
+
|
40
|
+
|
28
41
|
class Poster:
|
29
42
|
"""Class which can post a python callable function to Mechanical's main thread."""
|
30
43
|
|
@@ -37,7 +50,26 @@ class Poster:
|
|
37
50
|
|
38
51
|
self._poster = Ans.Common.WB1ManagedUtils.TaskPoster
|
39
52
|
|
40
|
-
def
|
53
|
+
def try_post(self, callable: typing.Callable) -> typing.Any:
|
54
|
+
"""Post the callable to Mechanical's main thread.
|
55
|
+
|
56
|
+
This does the same thing as `post` but if `callable`
|
57
|
+
raises an exception, try_post will raise the same
|
58
|
+
exception to the caller of `try_post`.
|
59
|
+
"""
|
60
|
+
|
61
|
+
def wrapped():
|
62
|
+
try:
|
63
|
+
return callable()
|
64
|
+
except Exception as e:
|
65
|
+
return PosterError(e)
|
66
|
+
|
67
|
+
result = self.post(wrapped)
|
68
|
+
if isinstance(result, PosterError):
|
69
|
+
raise result.error
|
70
|
+
return result
|
71
|
+
|
72
|
+
def post(self, callable: typing.Callable) -> typing.Any:
|
41
73
|
"""Post the callable to Mechanical's main thread.
|
42
74
|
|
43
75
|
The main thread needs to be receiving posted messages
|
@@ -23,8 +23,8 @@
|
|
23
23
|
"""This is the .NET assembly resolving for embedding Ansys Mechanical.
|
24
24
|
|
25
25
|
Note that for some Mechanical Addons - additional resolving may be
|
26
|
-
necessary. A resolve handler is shipped with Ansys Mechanical on
|
27
|
-
starting in version 23.1 and on
|
26
|
+
necessary. A resolve handler is shipped with Ansys Mechanical on Windows
|
27
|
+
starting in version 23.1 and on Linux starting in version 23.2
|
28
28
|
"""
|
29
29
|
|
30
30
|
|
@@ -36,6 +36,13 @@ def resolve(version):
|
|
36
36
|
clr.AddReference("Ansys.Mechanical.Embedding")
|
37
37
|
import Ansys # isort: skip
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
try:
|
40
|
+
assembly_resolver = Ansys.Mechanical.Embedding.AssemblyResolver
|
41
|
+
resolve_handler = assembly_resolver.MechanicalResolveEventHandler
|
42
|
+
System.AppDomain.CurrentDomain.AssemblyResolve += resolve_handler
|
43
|
+
except AttributeError:
|
44
|
+
error_msg = f"""Unable to resolve Mechanical assemblies. Please ensure the following:
|
45
|
+
1. Mechanical is installed.
|
46
|
+
2. A folder with the name "Ansys" does not exist in the same directory as the script being run.
|
47
|
+
"""
|
48
|
+
raise AttributeError(error_msg)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
|
2
|
+
# SPDX-License-Identifier: MIT
|
3
|
+
#
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
"""RPC and Mechanical service implementation."""
|
24
|
+
from .client import Client
|
25
|
+
|
26
|
+
# todo - provide an implementation of Server (RemoteMechancial) that installs the below
|
27
|
+
# from .default_server import RemoteMechanical
|
28
|
+
# and remove them from this import statement
|
29
|
+
# todo - combine Server and MechanicalService
|
30
|
+
from .server import (
|
31
|
+
DefaultServiceMethods,
|
32
|
+
MechanicalDefaultServer,
|
33
|
+
MechanicalEmbeddedServer,
|
34
|
+
MechanicalService,
|
35
|
+
)
|
36
|
+
from .utils import get_remote_methods, remote_method
|