ansys-tools-visualization-interface 0.1.0__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 (42) hide show
  1. ansys_tools_visualization_interface-0.1.0/LICENSE +21 -0
  2. ansys_tools_visualization_interface-0.1.0/PKG-INFO +126 -0
  3. ansys_tools_visualization_interface-0.1.0/README.rst +85 -0
  4. ansys_tools_visualization_interface-0.1.0/pyproject.toml +93 -0
  5. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/__init__.py +39 -0
  6. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/__init__.py +22 -0
  7. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/_base.py +45 -0
  8. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/__init__.py +26 -0
  9. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/pyvista.py +505 -0
  10. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/pyvista_interface.py +358 -0
  11. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/trame_local.py +72 -0
  12. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/trame_remote.py +63 -0
  13. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/trame_service.py +125 -0
  14. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/__init__.py +25 -0
  15. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/+xy.png +0 -0
  16. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/+xz.png +0 -0
  17. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/+yz.png +0 -0
  18. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/-xy.png +0 -0
  19. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/-xz.png +0 -0
  20. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/-yz.png +0 -0
  21. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/designpoint.png +0 -0
  22. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/downarrow.png +0 -0
  23. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/isometric.png +0 -0
  24. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/measurement.png +0 -0
  25. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/ruler.png +0 -0
  26. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/upxarrow.png +0 -0
  27. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/upyarrow.png +0 -0
  28. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/_images/upzarrow.png +0 -0
  29. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/button.py +80 -0
  30. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/displace_arrows.py +95 -0
  31. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/measure.py +90 -0
  32. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/ruler.py +93 -0
  33. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/view_button.py +91 -0
  34. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/backends/pyvista/widgets/widget.py +63 -0
  35. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/plotter.py +61 -0
  36. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/types/__init__.py +22 -0
  37. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/types/edge_plot.py +112 -0
  38. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/types/mesh_object_plot.py +175 -0
  39. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/utils/__init__.py +22 -0
  40. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/utils/clip_plane.py +96 -0
  41. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/utils/color.py +40 -0
  42. ansys_tools_visualization_interface-0.1.0/src/ansys/tools/visualization_interface/utils/logger.py +118 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ansys Internal
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.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.1
2
+ Name: ansys-tools-visualization-interface
3
+ Version: 0.1.0
4
+ Summary: A Python visualization interface for PyAnsys libraries
5
+ Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
+ Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
7
+ Requires-Python: >=3.9,<4
8
+ Description-Content-Type: text/x-rst
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Dist: pyvista >= 0.42.0,<1
19
+ Requires-Dist: beartype >= 0.17.0,<1
20
+ Requires-Dist: websockets >= 12.0,<13
21
+ Requires-Dist: trame >= 3.6.0,<4
22
+ Requires-Dist: trame-vtk >= 2.8.7,<3
23
+ Requires-Dist: trame-vuetify >= 2.4.3,<3
24
+ Requires-Dist: ansys-sphinx-theme==0.15.2 ; extra == "doc"
25
+ Requires-Dist: jupyter_sphinx==0.5.3 ; extra == "doc"
26
+ Requires-Dist: jupytext==1.16.2 ; extra == "doc"
27
+ Requires-Dist: nbsphinx==0.9.3 ; extra == "doc"
28
+ Requires-Dist: numpydoc==1.7.0 ; extra == "doc"
29
+ Requires-Dist: sphinx==7.3.7 ; extra == "doc"
30
+ Requires-Dist: sphinx-autoapi==3.1.0b0 ; extra == "doc"
31
+ Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "doc"
32
+ Requires-Dist: sphinx_design==0.5.0 ; extra == "doc"
33
+ Requires-Dist: sphinx-gallery==0.16.0 ; extra == "doc"
34
+ Requires-Dist: sphinx-jinja==2.0.2 ; extra == "doc"
35
+ Requires-Dist: pytest==8.2.0 ; extra == "tests"
36
+ Requires-Dist: pytest-pyvista==0.1.9 ; extra == "tests"
37
+ Requires-Dist: pytest-cov==5.0.0 ; extra == "tests"
38
+ Provides-Extra: doc
39
+ Provides-Extra: tests
40
+
41
+ Visualization Interface Tool
42
+ ============================
43
+ |pyansys| |python| |pypi| |MIT| |GH-CI| |pre-commit|
44
+
45
+ .. |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
46
+ :target: https://docs.pyansys.com/
47
+ :alt: PyAnsys
48
+
49
+ .. |python| image:: https://img.shields.io/pypi/pyversions/ansys-tools-visualization-interface?logo=pypi
50
+ :target: https://pypi.org/project/ansys-tools-visualization-interface/
51
+ :alt: Python
52
+
53
+ .. |pypi| image:: https://img.shields.io/pypi/v/ansys-tools-visualization-interface.svg?logo=python&logoColor=white
54
+ :target: https://pypi.org/project/ansys-tools-visualization-interface
55
+ :alt: PyPI
56
+
57
+ .. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
58
+ :target: https://opensource.org/licenses/MIT
59
+ :alt: MIT
60
+
61
+ .. |GH-CI| image:: https://github.com/ansys/ansys-tools-visualization-interface/actions/workflows/ci_cd.yml/badge.svg
62
+ :target: https://github.com/ansys/ansys-tools-visualization-interface/actions/workflows/ci_cd.yml
63
+ :alt: GH-CI
64
+
65
+ .. |pre-commit| image:: https://results.pre-commit.ci/badge/github/ansys/ansys-tools-visualization-interface/main.svg
66
+ :target: https://results.pre-commit.ci/latest/github/ansys/ansys-tools-visualization-interface/main
67
+ :alt: pre-commit.ci status
68
+
69
+ .. contents::
70
+
71
+ Overview
72
+ --------
73
+
74
+ Visualization Interface tool is a Python API that provides an interface between PyAnsys libraries and
75
+ different plotting backends.
76
+
77
+ Visualization Interface tool offers these main features:
78
+
79
+ * Serves as an interface between PyAnsys and other plotting libraries (although only
80
+ `PyVista <https://docs.pyvista.org/version/stable/>`_ is supported currently).
81
+ * Provides out-of-the box picking, viewing, and measuring functionalities.
82
+ * Supplies an extensible class for adding custom functionalities.
83
+
84
+ Documentation and issues
85
+ ------------------------
86
+
87
+ Documentation for the latest stable release of Visualization Interface tool is hosted
88
+ at `Visualization Interface tool documentation <https://visualization-interface.tools.docs.pyansys.com/version/dev/>`_.
89
+
90
+ The documentation has these sections:
91
+
92
+ - `Getting started <https://visualization-interface.tools.docs.pyansys.com/version/dev/getting_started/index.html>`_: Learn
93
+ how to install Visualization Interface tool in user mode and quickly begin using it.
94
+ - `User guide <https://visualization-interface.tools.docs.pyansys.com/version/dev/user_guide/index.html>`_: Understand key
95
+ concepts for implementing Visualization Interface tool in your workflow.
96
+ - `API reference <https://visualization-interface.tools.docs.pyansys.com/version/dev/api/index.html>`_: Understand how to
97
+ use Python to interact programmatically with Visualization Interface tool.
98
+ - `Examples <visualization-interface.tools.docs.pyansys.com/version/dev/examples/index.html>`_: Explore examples that
99
+ show how to use Visualization Interface tool to perform many different types of operations.
100
+ - `Contribute <https://visualization-interface.tools.docs.pyansys.com/version/dev/contributing/index.html>`_: Learn how to
101
+ contribute to the Visualization Interface tool codebase or documentation.
102
+
103
+ In the upper right corner of the documentation's title bar, there is an option
104
+ for switching from viewing the documentation for the latest stable release
105
+ to viewing the documentation for the development version or previously
106
+ released versions.
107
+
108
+ On the `Visualization Interface tool Issues <https://github.com/ansys/ansys-tools-visualization-interface/issues>`_
109
+ page, you can create issues to report bugs and request new features. On the
110
+ `Discussions <https://discuss.ansys.com/>`_ page on the Ansys Developer portal,
111
+ you can post questions, share ideas, and get community feedback.
112
+
113
+ If you have general questions about the PyAnsys ecosystem, email
114
+ `pyansys.core@ansys.com <pyansys.core@ansys.com>`_. If your
115
+ question is specific to Visualization Interface tool, ask your
116
+ question in an issue as described in the previous paragraph.
117
+
118
+ License
119
+ -------
120
+
121
+ Visualization Interface tool is licensed under the `MIT License <https://github.com/ansys/ansys-tools-visualization-interface/blob/main/LICENSE>`_.
122
+
123
+ Visualization Interface tool makes no commercial claim over Ansys whatsoever. This library adds a
124
+ Python interface for visualizing Ansys results without changing the core behavior or
125
+ license of the original Ansys software.
126
+
@@ -0,0 +1,85 @@
1
+ Visualization Interface Tool
2
+ ============================
3
+ |pyansys| |python| |pypi| |MIT| |GH-CI| |pre-commit|
4
+
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
+ :target: https://docs.pyansys.com/
7
+ :alt: PyAnsys
8
+
9
+ .. |python| image:: https://img.shields.io/pypi/pyversions/ansys-tools-visualization-interface?logo=pypi
10
+ :target: https://pypi.org/project/ansys-tools-visualization-interface/
11
+ :alt: Python
12
+
13
+ .. |pypi| image:: https://img.shields.io/pypi/v/ansys-tools-visualization-interface.svg?logo=python&logoColor=white
14
+ :target: https://pypi.org/project/ansys-tools-visualization-interface
15
+ :alt: PyPI
16
+
17
+ .. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
18
+ :target: https://opensource.org/licenses/MIT
19
+ :alt: MIT
20
+
21
+ .. |GH-CI| image:: https://github.com/ansys/ansys-tools-visualization-interface/actions/workflows/ci_cd.yml/badge.svg
22
+ :target: https://github.com/ansys/ansys-tools-visualization-interface/actions/workflows/ci_cd.yml
23
+ :alt: GH-CI
24
+
25
+ .. |pre-commit| image:: https://results.pre-commit.ci/badge/github/ansys/ansys-tools-visualization-interface/main.svg
26
+ :target: https://results.pre-commit.ci/latest/github/ansys/ansys-tools-visualization-interface/main
27
+ :alt: pre-commit.ci status
28
+
29
+ .. contents::
30
+
31
+ Overview
32
+ --------
33
+
34
+ Visualization Interface tool is a Python API that provides an interface between PyAnsys libraries and
35
+ different plotting backends.
36
+
37
+ Visualization Interface tool offers these main features:
38
+
39
+ * Serves as an interface between PyAnsys and other plotting libraries (although only
40
+ `PyVista <https://docs.pyvista.org/version/stable/>`_ is supported currently).
41
+ * Provides out-of-the box picking, viewing, and measuring functionalities.
42
+ * Supplies an extensible class for adding custom functionalities.
43
+
44
+ Documentation and issues
45
+ ------------------------
46
+
47
+ Documentation for the latest stable release of Visualization Interface tool is hosted
48
+ at `Visualization Interface tool documentation <https://visualization-interface.tools.docs.pyansys.com/version/dev/>`_.
49
+
50
+ The documentation has these sections:
51
+
52
+ - `Getting started <https://visualization-interface.tools.docs.pyansys.com/version/dev/getting_started/index.html>`_: Learn
53
+ how to install Visualization Interface tool in user mode and quickly begin using it.
54
+ - `User guide <https://visualization-interface.tools.docs.pyansys.com/version/dev/user_guide/index.html>`_: Understand key
55
+ concepts for implementing Visualization Interface tool in your workflow.
56
+ - `API reference <https://visualization-interface.tools.docs.pyansys.com/version/dev/api/index.html>`_: Understand how to
57
+ use Python to interact programmatically with Visualization Interface tool.
58
+ - `Examples <visualization-interface.tools.docs.pyansys.com/version/dev/examples/index.html>`_: Explore examples that
59
+ show how to use Visualization Interface tool to perform many different types of operations.
60
+ - `Contribute <https://visualization-interface.tools.docs.pyansys.com/version/dev/contributing/index.html>`_: Learn how to
61
+ contribute to the Visualization Interface tool codebase or documentation.
62
+
63
+ In the upper right corner of the documentation's title bar, there is an option
64
+ for switching from viewing the documentation for the latest stable release
65
+ to viewing the documentation for the development version or previously
66
+ released versions.
67
+
68
+ On the `Visualization Interface tool Issues <https://github.com/ansys/ansys-tools-visualization-interface/issues>`_
69
+ page, you can create issues to report bugs and request new features. On the
70
+ `Discussions <https://discuss.ansys.com/>`_ page on the Ansys Developer portal,
71
+ you can post questions, share ideas, and get community feedback.
72
+
73
+ If you have general questions about the PyAnsys ecosystem, email
74
+ `pyansys.core@ansys.com <pyansys.core@ansys.com>`_. If your
75
+ question is specific to Visualization Interface tool, ask your
76
+ question in an issue as described in the previous paragraph.
77
+
78
+ License
79
+ -------
80
+
81
+ Visualization Interface tool is licensed under the `MIT License <https://github.com/ansys/ansys-tools-visualization-interface/blob/main/LICENSE>`_.
82
+
83
+ Visualization Interface tool makes no commercial claim over Ansys whatsoever. This library adds a
84
+ Python interface for visualizing Ansys results without changing the core behavior or
85
+ license of the original Ansys software.
@@ -0,0 +1,93 @@
1
+ [build-system]
2
+ requires = ["flit_core >=3.2,<4"]
3
+ build-backend = "flit_core.buildapi"
4
+
5
+ [project]
6
+ name = "ansys-tools-visualization-interface"
7
+ version = "0.1.0"
8
+ description = "A Python visualization interface for PyAnsys libraries"
9
+ readme = "README.rst"
10
+ requires-python = ">=3.9,<4"
11
+ license = { file = "LICENSE" }
12
+ authors = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }]
13
+ maintainers = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Science/Research",
17
+ "Topic :: Scientific/Engineering :: Information Analysis",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ ]
25
+ dependencies = [
26
+ "pyvista >= 0.42.0,<1",
27
+ "beartype >= 0.17.0,<1",
28
+ "websockets >= 12.0,<13",
29
+ "trame >= 3.6.0,<4",
30
+ "trame-vtk >= 2.8.7,<3",
31
+ "trame-vuetify >= 2.4.3,<3",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ tests = ["pytest==8.2.0", "pytest-pyvista==0.1.9", "pytest-cov==5.0.0"]
36
+ doc = [
37
+ "ansys-sphinx-theme==0.15.2",
38
+ "jupyter_sphinx==0.5.3",
39
+ "jupytext==1.16.2",
40
+ "nbsphinx==0.9.3",
41
+ "numpydoc==1.7.0",
42
+ "sphinx==7.3.7",
43
+ "sphinx-autoapi==3.1.0b0",
44
+ "sphinx-copybutton==0.5.2",
45
+ "sphinx_design==0.5.0",
46
+ "sphinx-gallery==0.16.0",
47
+ "sphinx-jinja==2.0.2",
48
+ ]
49
+
50
+ [tool.flit.module]
51
+ name = "ansys.tools.visualization_interface"
52
+
53
+ [tool.black]
54
+ line-length = 100
55
+
56
+ [tool.isort]
57
+ profile = "black"
58
+ force_sort_within_sections = true
59
+ line_length = 100
60
+ default_section = "THIRDPARTY"
61
+ src_paths = ["doc", "src", "tests"]
62
+
63
+ [tool.pytest.ini_options]
64
+ addopts = "-ra --cov=ansys.tools.visualization_interface --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv --image_cache_dir tests/_image_cache --add_missing_images"
65
+
66
+ [tool.ruff]
67
+ line-length = 120
68
+ extend-exclude = ["examples/**/*.py"]
69
+
70
+ [tool.ruff.lint]
71
+ select = [
72
+ "E", # pycodestyle, see https://beta.ruff.rs/docs/rules/#pycodestyle-e-w
73
+ "D", # pydocstyle, see https://beta.ruff.rs/docs/rules/#pydocstyle-d
74
+ "F", # pyflakes, see https://beta.ruff.rs/docs/rules/#pyflakes-f
75
+ "I", # isort, see https://beta.ruff.rs/docs/rules/#isort-i
76
+ "N", # pep8-naming, see https://beta.ruff.rs/docs/rules/#pep8-naming-n
77
+ "PTH", # flake8-use-pathlib, https://beta.ruff.rs/docs/rules/#flake8-use-pathlib-pth
78
+ ]
79
+ ignore = ["D416"]
80
+
81
+ [tool.ruff.format]
82
+ quote-style = "double"
83
+ indent-style = "tab"
84
+ line-ending = "auto"
85
+
86
+ [tool.ruff.lint.isort]
87
+ combine-as-imports = true
88
+ force-sort-within-sections = true
89
+ known-first-party = ["ansys"]
90
+
91
+ [tool.ruff.lint.pydocstyle]
92
+ # Settings: https://docs.astral.sh/ruff/settings/#lintpydocstyle
93
+ convention = "google"
@@ -0,0 +1,39 @@
1
+ # Copyright (C) 2023 - 2024 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
+ """Visualization Interface tool is a Python client library for visualizing the results of Ansys simulations."""
23
+ import os
24
+
25
+ import pkg_resources
26
+
27
+ __version__ = pkg_resources.get_distribution("ansys-tools-visualization-interface").version
28
+
29
+ USE_TRAME: bool = False
30
+ DOCUMENTATION_BUILD: bool = False
31
+ TESTING_MODE: bool = os.environ.get("PYANSYS_VISUALIZER_TESTMODE", "false").lower() == "true"
32
+
33
+ from ansys.tools.visualization_interface.plotter import Plotter # noqa: F401, E402
34
+ from ansys.tools.visualization_interface.types.edge_plot import EdgePlot # noqa: F401, E402
35
+ from ansys.tools.visualization_interface.types.mesh_object_plot import ( # noqa: F401, E402
36
+ MeshObjectPlot,
37
+ )
38
+ from ansys.tools.visualization_interface.utils.clip_plane import ClipPlane # noqa: F401, E402
39
+ from ansys.tools.visualization_interface.utils.color import Color # noqa: F401, E402
@@ -0,0 +1,22 @@
1
+ # Copyright (C) 2023 - 2024 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
+ """Provides interfaces."""
@@ -0,0 +1,45 @@
1
+ # Copyright (C) 2024 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
+ """Module for the backend base class."""
24
+ from abc import ABC, abstractmethod
25
+
26
+ from beartype.typing import Any, Iterable
27
+
28
+
29
+ class BaseBackend(ABC):
30
+ """Base class for plotting backends."""
31
+
32
+ @abstractmethod
33
+ def plot(self, object: Any, **plotting_options):
34
+ """Plot the specified object."""
35
+ raise NotImplementedError("plot method must be implemented")
36
+
37
+ @abstractmethod
38
+ def plot_iter(self, object: Iterable):
39
+ """Plot the elements of an iterable."""
40
+ raise NotImplementedError("plot_iter method must be implemented")
41
+
42
+ @abstractmethod
43
+ def show(self):
44
+ """Show the plotted objects."""
45
+ raise NotImplementedError("show method must be implemented")
@@ -0,0 +1,26 @@
1
+ # Copyright (C) 2023 - 2024 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
+ """Provides interfaces."""
23
+ from ansys.tools.visualization_interface.backends.pyvista.pyvista import ( # noqa: F401
24
+ PyVistaBackend,
25
+ PyVistaBackendInterface,
26
+ )