ansys-speos-core 0.5.2__tar.gz → 0.6.1__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.
Files changed (46) hide show
  1. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/PKG-INFO +59 -21
  2. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/README.rst +44 -6
  3. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/pyproject.toml +15 -15
  4. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/body.py +30 -0
  5. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/generic/constants.py +1 -1
  6. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/generic/general_methods.py +83 -0
  7. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/generic/visualization_methods.py +147 -14
  8. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/face.py +156 -45
  9. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/proto_message_utils.py +2 -0
  10. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/scene.py +50 -2
  11. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/lxp.py +1 -52
  12. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/opt_prop.py +12 -4
  13. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/part.py +7 -9
  14. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/project.py +278 -177
  15. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/proto_message_utils.py +5 -2
  16. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/sensor.py +732 -32
  17. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/simulation.py +204 -5
  18. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/source.py +828 -3
  19. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/workflow/combine_speos.py +1 -1
  20. ansys_speos_core-0.6.1/src/ansys/speos/core/workflow/open_result.py +404 -0
  21. ansys_speos_core-0.5.2/src/ansys/speos/core/workflow/open_result.py +0 -144
  22. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/LICENSE +0 -0
  23. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/__init__.py +0 -0
  24. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/bsdf.py +0 -0
  25. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/face.py +0 -0
  26. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/geo_ref.py +0 -0
  27. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/intensity.py +0 -0
  28. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/__init__.py +0 -0
  29. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/body.py +0 -0
  30. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/client.py +0 -0
  31. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/crud.py +0 -0
  32. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/intensity_template.py +0 -0
  33. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/job.py +0 -0
  34. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/part.py +0 -0
  35. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/sensor_template.py +0 -0
  36. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/simulation_template.py +0 -0
  37. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/sop_template.py +0 -0
  38. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/source_template.py +0 -0
  39. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/spectrum.py +0 -0
  40. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/kernel/vop_template.py +0 -0
  41. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/launcher.py +0 -0
  42. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/logger.py +0 -0
  43. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/py.typed +0 -0
  44. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/spectrum.py +0 -0
  45. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/speos.py +0 -0
  46. {ansys_speos_core-0.5.2 → ansys_speos_core-0.6.1}/src/ansys/speos/core/workflow/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ansys-speos-core
3
- Version: 0.5.2
3
+ Version: 0.6.1
4
4
  Summary: A Python wrapper for Ansys Speos
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
@@ -21,13 +21,13 @@ Classifier: Topic :: Scientific/Engineering :: Physics
21
21
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
22
22
  License-File: LICENSE
23
23
  Requires-Dist: protobuf>=3.20,<7
24
- Requires-Dist: grpcio>=1.50.0,<1.71
24
+ Requires-Dist: grpcio>=1.50.0,<1.75
25
25
  Requires-Dist: grpcio-health-checking>=1.45.0,<1.68
26
- Requires-Dist: ansys-api-speos==0.14.2
26
+ Requires-Dist: ansys-api-speos==0.15.3
27
27
  Requires-Dist: ansys-tools-path>=0.3.1
28
28
  Requires-Dist: numpy>=1.20.3,<3
29
- Requires-Dist: comtypes>=1.4,<1.5
30
- Requires-Dist: ansys-sphinx-theme==1.4.4 ; extra == "doc"
29
+ Requires-Dist: comtypes>=1.4,<1.5; platform_system=='Windows'
30
+ Requires-Dist: ansys-sphinx-theme==1.6.0 ; extra == "doc"
31
31
  Requires-Dist: numpydoc==1.8.0 ; extra == "doc"
32
32
  Requires-Dist: Sphinx==8.1.3 ; extra == "doc"
33
33
  Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "doc"
@@ -37,26 +37,26 @@ Requires-Dist: sphinx-jinja==2.0.2 ; extra == "doc"
37
37
  Requires-Dist: sphinxcontrib-mermaid==1.0.0 ; extra == "doc"
38
38
  Requires-Dist: myst-parser==4.0.1 ; extra == "doc"
39
39
  Requires-Dist: nbsphinx==0.9.7 ; extra == "doc"
40
- Requires-Dist: jupytext==1.17.1 ; extra == "doc"
41
- Requires-Dist: jupyterlab==4.4.2 ; extra == "doc"
42
- Requires-Dist: jupyter-server==2.16.0 ; extra == "doc"
40
+ Requires-Dist: jupytext==1.17.3 ; extra == "doc"
41
+ Requires-Dist: jupyterlab==4.4.7 ; extra == "doc"
42
+ Requires-Dist: jupyter-server==2.17.0 ; extra == "doc"
43
43
  Requires-Dist: nbconvert==7.16.6 ; extra == "doc"
44
- Requires-Dist: pyvista[jupyter]>=0.43,<0.46 ; extra == "doc"
44
+ Requires-Dist: pyvista[jupyter]>=0.43,<0.47 ; extra == "doc"
45
45
  Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "doc"
46
- Requires-Dist: pyvista>=0.40.0,<0.46 ; extra == "graphics"
46
+ Requires-Dist: pyvista>=0.40.0,<0.47 ; extra == "graphics"
47
47
  Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "graphics"
48
48
  Requires-Dist: matplotlib ; extra == "jupyter"
49
49
  Requires-Dist: jupyterlab>=3 ; extra == "jupyter"
50
50
  Requires-Dist: ipywidgets ; extra == "jupyter"
51
- Requires-Dist: pyvista[jupyter]>=0.43,<0.46 ; extra == "jupyter"
51
+ Requires-Dist: pyvista[jupyter]>=0.43,<0.47 ; extra == "jupyter"
52
52
  Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "jupyter"
53
- Requires-Dist: notebook==7.4.2 ; extra == "jupyter"
53
+ Requires-Dist: notebook==7.4.5 ; extra == "jupyter"
54
54
  Requires-Dist: psutil==7.0.0 ; extra == "tests"
55
- Requires-Dist: pytest==8.3.5 ; extra == "tests"
56
- Requires-Dist: pyvista>=0.40.0,<0.46 ; extra == "tests"
55
+ Requires-Dist: pytest==8.4.2 ; extra == "tests"
56
+ Requires-Dist: pyvista>=0.40.0,<0.47 ; extra == "tests"
57
57
  Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "tests"
58
58
  Requires-Dist: ansys-platform-instancemanagement>=1.0.3 ; extra == "tests"
59
- Requires-Dist: pytest-cov==6.1.1 ; extra == "tests"
59
+ Requires-Dist: pytest-cov==6.3.0 ; extra == "tests"
60
60
  Project-URL: Changelog, https://github.com/ansys/pyspeos/blob/main/doc/source/changelog.rst
61
61
  Project-URL: Discussions, https://github.com/ansys/pyspeos/discussions
62
62
  Project-URL: Documentation, https://speos.docs.pyansys.com/
@@ -70,12 +70,24 @@ Provides-Extra: tests
70
70
 
71
71
  PySpeos library
72
72
  ================
73
- |pyansys| |GH-CI| |MIT| |ruff|
73
+ |pyansys| |python| |pypi| |codecov| |GH-CI| |MIT| |ruff|
74
74
 
75
75
  .. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
76
76
  :target: https://docs.pyansys.com/
77
77
  :alt: PyAnsys
78
78
 
79
+ .. |python| image:: https://img.shields.io/pypi/pyversions/ansys-speos-core?logo=pypi
80
+ :target: https://pypi.org/project/ansys-speos-core/
81
+ :alt: Python
82
+
83
+ .. |pypi| image:: https://img.shields.io/pypi/v/ansys-speos-core.svg?logo=python&logoColor=white&label=PyPI
84
+ :target: https://pypi.org/project/ansys-speos-core
85
+ :alt: PyPI
86
+
87
+ .. |codecov| image:: https://codecov.io/github/ansys/pyspeos/graph/badge.svg?token=34FKDS6ZKJ
88
+ :target: https://codecov.io/github/ansys/pyspeos
89
+ :alt: Codecov
90
+
79
91
  .. |GH-CI| image:: https://github.com/ansys/pyspeos/actions/workflows/ci_cd.yml/badge.svg
80
92
  :target: https://github.com/ansys/pyspeos/actions/workflows/ci_cd.yml
81
93
 
@@ -90,7 +102,7 @@ PySpeos library
90
102
 
91
103
  Project overview
92
104
  ----------------
93
- ``PySpeos`` is a Python library that gathers functionalities and tools based on remote API of Ansys software `Speos <https://www.ansys.com/products/optics>`_ .
105
+ ``PySpeos`` is a Python library that gathers functionalities and tools based on remote API provided by gRPC server of Ansys software `Speos <https://www.ansys.com/products/optics>`_ .
94
106
 
95
107
  Installation
96
108
  ------------
@@ -98,7 +110,6 @@ Installation can be done using the published `package`_ or the repository `sourc
98
110
 
99
111
  Package
100
112
  ~~~~~~~
101
- .. warning:: Release is in progress. It might take some time before it becomes available. Until then, please use `Sources`_.
102
113
 
103
114
  This repository is deployed as the Python packages `ansys-speos-core <https://pypi.org/project/ansys-speos-core>`_.
104
115
  As usual, installation is done by running:
@@ -201,12 +212,12 @@ Then, to launch SpeosRPC server with product version 2025.1, you can run:
201
212
  export LICENSE_SERVER=1055@XXX.XXX.XXX.XXX
202
213
 
203
214
  cat GH_TOKEN.txt | docker login ghcr.io -u "$GH_USERNAME" --password-stdin
204
- docker pull ghcr.io/ansys/speos-rpc:251
205
- docker run --detach --name speos-rpc -p 50098:50098 -e ANSYSLMD_LICENSE_FILE=$LICENSE_SERVER --entrypoint /app/SpeosRPC_Server.x ghcr.io/ansys/speos-rpc:251
215
+ docker pull ghcr.io/ansys/speos-rpc:252
216
+ docker run --detach --name speos-rpc -p 50098:50098 -e ANSYSLMD_LICENSE_FILE=$LICENSE_SERVER --entrypoint /app/SpeosRPC_Server.x ghcr.io/ansys/speos-rpc:252
206
217
 
207
218
  .. note::
208
219
 
209
- To use the latest image in development, you can use `ghcr.io/ansys/speos-rpc:dev`.
220
+ To use the latest image in development, you can use `ghcr.io/ansys/speos-rpc:252`.
210
221
 
211
222
  On the other hand, the SpeosRPC server can be started locally.
212
223
 
@@ -250,6 +261,33 @@ Use jupyter notebook
250
261
 
251
262
  jupyter notebook can be downloaded from the documentations example section.
252
263
 
264
+ Features
265
+ --------
266
+
267
+ Information of the latest stable release features:
268
+
269
+ PySpeos core features
270
+ ~~~~~~~~~~~~~~~~~~~~~
271
+
272
+ Features supported in the latest release can be found at:
273
+
274
+ * `Optical Materials <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/opt_prop/OptProp.html>`_
275
+ * `Light Sources <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/source/index.html>`_
276
+ * `Sensors <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/sensor/index.html>`_
277
+ * `Simulations <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/simulation/index.html>`_
278
+ * `BSDF Viewer <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/bsdf/index.html>`_
279
+ * `Light Path Finder <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/lxp/LightPathFinder.html>`_
280
+
281
+ Speos RPC features
282
+ ~~~~~~~~~~~~~~~~~~
283
+
284
+ Speos RPC is based on a gRPC server and provides APIs to interact with Speos solver.
285
+
286
+ Features supported in the latest Speos RPC can be found at:
287
+ `Ansys Speos for developers Speos RPC <https://developer.ansys.com/docs/speos>`_.
288
+
289
+
290
+
253
291
  License
254
292
  -------
255
293
  `PySpeos`_ is licensed under the MIT license.
@@ -1,11 +1,23 @@
1
1
  PySpeos library
2
2
  ================
3
- |pyansys| |GH-CI| |MIT| |ruff|
3
+ |pyansys| |python| |pypi| |codecov| |GH-CI| |MIT| |ruff|
4
4
 
5
5
  .. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
6
6
  :target: https://docs.pyansys.com/
7
7
  :alt: PyAnsys
8
8
 
9
+ .. |python| image:: https://img.shields.io/pypi/pyversions/ansys-speos-core?logo=pypi
10
+ :target: https://pypi.org/project/ansys-speos-core/
11
+ :alt: Python
12
+
13
+ .. |pypi| image:: https://img.shields.io/pypi/v/ansys-speos-core.svg?logo=python&logoColor=white&label=PyPI
14
+ :target: https://pypi.org/project/ansys-speos-core
15
+ :alt: PyPI
16
+
17
+ .. |codecov| image:: https://codecov.io/github/ansys/pyspeos/graph/badge.svg?token=34FKDS6ZKJ
18
+ :target: https://codecov.io/github/ansys/pyspeos
19
+ :alt: Codecov
20
+
9
21
  .. |GH-CI| image:: https://github.com/ansys/pyspeos/actions/workflows/ci_cd.yml/badge.svg
10
22
  :target: https://github.com/ansys/pyspeos/actions/workflows/ci_cd.yml
11
23
 
@@ -20,7 +32,7 @@ PySpeos library
20
32
 
21
33
  Project overview
22
34
  ----------------
23
- ``PySpeos`` is a Python library that gathers functionalities and tools based on remote API of Ansys software `Speos <https://www.ansys.com/products/optics>`_ .
35
+ ``PySpeos`` is a Python library that gathers functionalities and tools based on remote API provided by gRPC server of Ansys software `Speos <https://www.ansys.com/products/optics>`_ .
24
36
 
25
37
  Installation
26
38
  ------------
@@ -28,7 +40,6 @@ Installation can be done using the published `package`_ or the repository `sourc
28
40
 
29
41
  Package
30
42
  ~~~~~~~
31
- .. warning:: Release is in progress. It might take some time before it becomes available. Until then, please use `Sources`_.
32
43
 
33
44
  This repository is deployed as the Python packages `ansys-speos-core <https://pypi.org/project/ansys-speos-core>`_.
34
45
  As usual, installation is done by running:
@@ -131,12 +142,12 @@ Then, to launch SpeosRPC server with product version 2025.1, you can run:
131
142
  export LICENSE_SERVER=1055@XXX.XXX.XXX.XXX
132
143
 
133
144
  cat GH_TOKEN.txt | docker login ghcr.io -u "$GH_USERNAME" --password-stdin
134
- docker pull ghcr.io/ansys/speos-rpc:251
135
- docker run --detach --name speos-rpc -p 50098:50098 -e ANSYSLMD_LICENSE_FILE=$LICENSE_SERVER --entrypoint /app/SpeosRPC_Server.x ghcr.io/ansys/speos-rpc:251
145
+ docker pull ghcr.io/ansys/speos-rpc:252
146
+ docker run --detach --name speos-rpc -p 50098:50098 -e ANSYSLMD_LICENSE_FILE=$LICENSE_SERVER --entrypoint /app/SpeosRPC_Server.x ghcr.io/ansys/speos-rpc:252
136
147
 
137
148
  .. note::
138
149
 
139
- To use the latest image in development, you can use `ghcr.io/ansys/speos-rpc:dev`.
150
+ To use the latest image in development, you can use `ghcr.io/ansys/speos-rpc:252`.
140
151
 
141
152
  On the other hand, the SpeosRPC server can be started locally.
142
153
 
@@ -180,6 +191,33 @@ Use jupyter notebook
180
191
 
181
192
  jupyter notebook can be downloaded from the documentations example section.
182
193
 
194
+ Features
195
+ --------
196
+
197
+ Information of the latest stable release features:
198
+
199
+ PySpeos core features
200
+ ~~~~~~~~~~~~~~~~~~~~~
201
+
202
+ Features supported in the latest release can be found at:
203
+
204
+ * `Optical Materials <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/opt_prop/OptProp.html>`_
205
+ * `Light Sources <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/source/index.html>`_
206
+ * `Sensors <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/sensor/index.html>`_
207
+ * `Simulations <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/simulation/index.html>`_
208
+ * `BSDF Viewer <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/bsdf/index.html>`_
209
+ * `Light Path Finder <https://speos.docs.pyansys.com/version/stable/api/ansys/speos/core/lxp/LightPathFinder.html>`_
210
+
211
+ Speos RPC features
212
+ ~~~~~~~~~~~~~~~~~~
213
+
214
+ Speos RPC is based on a gRPC server and provides APIs to interact with Speos solver.
215
+
216
+ Features supported in the latest Speos RPC can be found at:
217
+ `Ansys Speos for developers Speos RPC <https://developer.ansys.com/docs/speos>`_.
218
+
219
+
220
+
183
221
  License
184
222
  -------
185
223
  `PySpeos`_ is licensed under the MIT license.
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "ansys-speos-core"
7
- version = "0.5.2"
7
+ version = "0.6.1"
8
8
  description = "A Python wrapper for Ansys Speos"
9
9
  readme = "README.rst"
10
10
  requires-python = ">=3.10"
@@ -28,37 +28,37 @@ classifiers=[
28
28
  ]
29
29
  dependencies=[
30
30
  "protobuf>=3.20,<7",
31
- "grpcio>=1.50.0,<1.71",
31
+ "grpcio>=1.50.0,<1.75",
32
32
  "grpcio-health-checking>=1.45.0,<1.68",
33
- "ansys-api-speos==0.14.2",
33
+ "ansys-api-speos==0.15.3",
34
34
  "ansys-tools-path>=0.3.1",
35
35
  "numpy>=1.20.3,<3",
36
- "comtypes>=1.4,<1.5",
36
+ "comtypes>=1.4,<1.5; platform_system=='Windows'",
37
37
  ]
38
38
 
39
39
  [project.optional-dependencies]
40
40
  graphics = [
41
- "pyvista>=0.40.0,<0.46",
41
+ "pyvista>=0.40.0,<0.47",
42
42
  "ansys-tools-visualization-interface>=0.8.3",
43
43
  ]
44
44
  tests = [
45
45
  "psutil==7.0.0",
46
- "pytest==8.3.5",
47
- "pyvista>=0.40.0,<0.46",
46
+ "pytest==8.4.2",
47
+ "pyvista>=0.40.0,<0.47",
48
48
  "ansys-tools-visualization-interface>=0.8.3",
49
49
  "ansys-platform-instancemanagement>=1.0.3",
50
- "pytest-cov==6.1.1",
50
+ "pytest-cov==6.3.0",
51
51
  ]
52
52
  jupyter = [
53
53
  "matplotlib",
54
54
  "jupyterlab>=3",
55
55
  "ipywidgets",
56
- "pyvista[jupyter]>=0.43,<0.46",
56
+ "pyvista[jupyter]>=0.43,<0.47",
57
57
  "ansys-tools-visualization-interface>=0.8.3",
58
- "notebook==7.4.2",
58
+ "notebook==7.4.5",
59
59
  ]
60
60
  doc = [
61
- "ansys-sphinx-theme==1.4.4",
61
+ "ansys-sphinx-theme==1.6.0",
62
62
  "numpydoc==1.8.0",
63
63
  "Sphinx==8.1.3",
64
64
  "sphinx-copybutton==0.5.2",
@@ -68,11 +68,11 @@ doc = [
68
68
  "sphinxcontrib-mermaid==1.0.0",
69
69
  "myst-parser==4.0.1",
70
70
  "nbsphinx==0.9.7",
71
- "jupytext==1.17.1",
72
- "jupyterlab==4.4.2",
73
- "jupyter-server==2.16.0",
71
+ "jupytext==1.17.3",
72
+ "jupyterlab==4.4.7",
73
+ "jupyter-server==2.17.0",
74
74
  "nbconvert==7.16.6",
75
- "pyvista[jupyter]>=0.43,<0.46",
75
+ "pyvista[jupyter]>=0.43,<0.47",
76
76
  "ansys-tools-visualization-interface>=0.8.3",
77
77
  ]
78
78
 
@@ -29,6 +29,8 @@ from typing import List, Mapping, Optional, Union
29
29
 
30
30
  from ansys.speos.core import proto_message_utils
31
31
  import ansys.speos.core.face as face
32
+ import ansys.speos.core.generic.general_methods as general_methods
33
+ from ansys.speos.core.generic.visualization_methods import _VisualData
32
34
  from ansys.speos.core.geo_ref import GeoRef
33
35
  from ansys.speos.core.kernel.body import ProtoBody
34
36
  from ansys.speos.core.kernel.client import SpeosClient
@@ -72,6 +74,7 @@ class Body:
72
74
  self._parent_part = parent_part
73
75
  self._name = name
74
76
  self.body_link = None
77
+ self._visual_data = _VisualData() if general_methods._GRAPHICS_AVAILABLE else None
75
78
  """Link object for the body in database."""
76
79
 
77
80
  if metadata is None:
@@ -82,6 +85,30 @@ class Body:
82
85
 
83
86
  self._geom_features = []
84
87
 
88
+ @property
89
+ def visual_data(self):
90
+ """Property containing irradiance sensor visualization data.
91
+
92
+ Returns
93
+ -------
94
+ VisualData
95
+ Instance of VisualData Class for pyvista.PolyData of feature faces, coordinate_systems.
96
+
97
+ """
98
+ import numpy as np
99
+
100
+ if self._visual_data.updated is True:
101
+ return self._visual_data
102
+ for feature_face in self._geom_features:
103
+ vertices = np.array(feature_face._face.vertices).reshape(-1, 3)
104
+ facets = np.array(feature_face._face.facets).reshape(-1, 3)
105
+ temp = np.full(facets.shape[0], 3)
106
+ temp = np.vstack(temp)
107
+ facets = np.hstack((temp, facets))
108
+ self._visual_data.add_data_mesh(vertices, facets)
109
+ self._visual_data.updated = True
110
+ return self._visual_data
111
+
85
112
  @property
86
113
  def geo_path(self) -> GeoRef:
87
114
  """Geometry path to be used within other speos objects."""
@@ -159,6 +186,9 @@ class Body:
159
186
  ansys.speos.core.body.Body
160
187
  Body feature.
161
188
  """
189
+ if general_methods._GRAPHICS_AVAILABLE:
190
+ self._visual_data.updated = False
191
+
162
192
  # Commit faces contained in this body
163
193
  for g in self._geom_features:
164
194
  g.commit()
@@ -28,7 +28,7 @@ DEFAULT_HOST: str = "localhost"
28
28
  """Default host used by Speos RPC server and client """
29
29
  DEFAULT_PORT: str = "50098"
30
30
  """Default port used by Speos RPC server and client """
31
- DEFAULT_VERSION: str = "251"
31
+ DEFAULT_VERSION: str = "252"
32
32
  """Latest supported Speos version of the current PySpeos Package"""
33
33
  MAX_SERVER_MESSAGE_LENGTH: int = int(os.environ.get("SPEOS_MAX_MESSAGE_LENGTH", 256 * 1024**2))
34
34
  """Maximum message length value accepted by the Speos RPC server,
@@ -25,6 +25,8 @@
25
25
  this includes decorator and methods
26
26
  """
27
27
 
28
+ from __future__ import annotations
29
+
28
30
  from collections.abc import Collection
29
31
  from functools import lru_cache, wraps
30
32
  import os
@@ -44,6 +46,8 @@ GRAPHICS_ERROR = (
44
46
  "You can install this using `pip install ansys-speos-core[graphics]`."
45
47
  )
46
48
 
49
+ VERSION_ERROR = "The pySpeos feature : {feature_name} needs a Speos Version of {version} or higher."
50
+
47
51
 
48
52
  def deprecate_kwargs(old_arguments: dict, removed_version="0.3.0"):
49
53
  """Issues deprecation warnings for arguments.
@@ -230,3 +234,82 @@ def retrieve_speos_install_dir(
230
234
  if not speos_exec.is_file():
231
235
  error_no_install(speos_rpc_path, int(version))
232
236
  return speos_rpc_path
237
+
238
+
239
+ def wavelength_to_rgb(wavelength: float, gamma: float = 0.8) -> [int, int, int, int]:
240
+ """Convert a given wavelength of light to an approximate RGB color value.
241
+
242
+ The wavelength must be given in nanometers in the range from 380 nm to 750 nm.
243
+ Based on the code from http://www.physics.sfasu.edu/astro/color/spectra.html
244
+
245
+ Parameters
246
+ ----------
247
+ wavelength : float
248
+ Wavelength in nanometer between 380-750 nm
249
+ gamma : float
250
+ Gamma value.
251
+ By default : ``0.8``
252
+ """
253
+ wavelength = float(wavelength)
254
+ if 380 <= wavelength <= 440:
255
+ attenuation = 0.3 + 0.7 * (wavelength - 380) / (440 - 380)
256
+ r = ((-(wavelength - 440) / (440 - 380)) * attenuation) ** gamma
257
+ g = 0.0
258
+ b = (1.0 * attenuation) ** gamma
259
+ elif 440 <= wavelength <= 490:
260
+ r = 0.0
261
+ g = ((wavelength - 440) / (490 - 440)) ** gamma
262
+ b = 1.0
263
+ elif 490 <= wavelength <= 510:
264
+ r = 0.0
265
+ g = 1.0
266
+ b = (-(wavelength - 510) / (510 - 490)) ** gamma
267
+ elif 510 <= wavelength <= 580:
268
+ r = ((wavelength - 510) / (580 - 510)) ** gamma
269
+ g = 1.0
270
+ b = 0.0
271
+ elif 580 <= wavelength <= 645:
272
+ r = 1.0
273
+ g = (-(wavelength - 645) / (645 - 580)) ** gamma
274
+ b = 0.0
275
+ elif 645 <= wavelength <= 750:
276
+ attenuation = 0.3 + 0.7 * (750 - wavelength) / (750 - 645)
277
+ r = (1.0 * attenuation) ** gamma
278
+ g = 0.0
279
+ b = 0.0
280
+ else:
281
+ r = 0.0
282
+ g = 0.0
283
+ b = 0.0
284
+ r *= 255
285
+ g *= 255
286
+ b *= 255
287
+ return [int(r), int(g), int(b), 255]
288
+
289
+
290
+ def min_speos_version(major: int, minor: int, service_pack: int):
291
+ """Raise version warning.
292
+
293
+ Parameters
294
+ ----------
295
+ major : int
296
+ Major release version, e.g. 25
297
+ minor : int
298
+ Minor release version e.g. 1
299
+ service_pack : int
300
+ Service Pack version e.g. 3
301
+ """
302
+ version = f"20{major} R{minor} SP{service_pack}"
303
+
304
+ def decorator(function):
305
+ def wrapper(*args, **kwargs):
306
+ if function.__qualname__.endswith("__init__"):
307
+ name = function.__qualname__[:-9]
308
+ else:
309
+ name = function.__qualname__
310
+ warnings.warn(VERSION_ERROR.format(version=version, feature_name=name), stacklevel=2)
311
+ return function(*args, **kwargs)
312
+
313
+ return wrapper
314
+
315
+ return decorator