You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
concepts for implementing the Ansys tools in your workflow.
46
+
concepts for implementing the tools in your workflows.
49
47
- `API reference <https://ansys.tools.docs.pyansys.com/version/stable/api/index.html>`_: Understand how to
50
-
use Python to interact programmatically with the Ansys tools.
51
-
- `Examples <https://ansys.tools.docs.pyansys.com/version/stable/examples/index.html>`_: Explore examples that
52
-
show how to use the Ansys tools Tool to perform many different types of operations.
48
+
use Python to interact programmatically with the tools.
53
49
- `Contribute <https://ansys.tools.docs.pyansys.com/version/stable/contributing.html>`_: Learn how to
54
-
contribute to the Ansys tools codebase or documentation.
50
+
contribute to the Ansys Common Tools codebase or documentation.
55
51
56
52
In the upper right corner of the documentation's title bar, there is an option
57
53
for switching from viewing the documentation for the latest stable release
58
54
to viewing the documentation for the development version or previously
59
55
released versions.
60
56
61
-
On the `Ansys tools Issues <https://github.com/ansys/ansys-tools-common/issues>`_
62
-
page, you can create issues to report bugs and request new features. On the
63
-
`Discussions <https://discuss.ansys.com/>`_ page on the Ansys Developer portal,
57
+
On the Ansys Common Tools `Issues <https://github.com/ansys/ansys-tools-common/issues>`_
58
+
page, you can create issues to report bugs and request new features. On the `Ansys Common Tools Discussions <https://github.com/ansys/ansys-tools-common/discussions>`_ page
59
+
or the `Discussions <https://discuss.ansys.com/>`_ page on the Ansys Developer portal,
64
60
you can post questions, share ideas, and get community feedback.
65
61
66
62
If you have general questions about the PyAnsys ecosystem, email
in the *PyAnsys developer's guide*. Ensure that you are thoroughly familiar
9
-
with this guide before attempting to contribute to the Ansys tools common repository.
9
+
with this guide before attempting to contribute to Ansys Common Tools.
10
10
11
-
The following contribution information is specific to the Ansys tools common.
11
+
The following contribution information is specific to Ansys Common Tools.
12
12
13
13
Install in developer mode
14
14
-------------------------
15
15
16
-
Installing the Ansys tools in developer mode allows you to modify and enhance
17
-
the source.
16
+
Installing Ansys Common Tools in developer mode allows you to modify and enhance the source.
18
17
19
-
To clone and install the latest Ansys tools release in development mode, run
20
-
these commands:
18
+
To clone and install the latest Ansys Common Tools release in development mode, run these commands:
21
19
22
20
.. code::
23
21
@@ -29,22 +27,20 @@ these commands:
29
27
Run tests
30
28
---------
31
29
32
-
Ansys tools common uses `pytest <https://docs.pytest.org/en/stable/>`_ for testing.
30
+
Ansys Common Tools uses `pytest <https://docs.pytest.org/en/stable/>`_ for testing.
33
31
34
-
#. Prior to running tests, you must run this command to install
35
-
test dependencies::
32
+
#. Prior to running tests, you must run this command to install test dependencies::
36
33
37
34
pip install -e .[tests]
38
35
39
-
#. To then run the tests, navigate to the root directory of the repository and run this
40
-
command::
36
+
#. To then run the tests, navigate to the root directory of the repository and run this command::
41
37
42
38
pytest
43
39
44
40
Adhere to code style
45
41
--------------------
46
42
47
-
The Ansys tools common follows the PEP8 standard as outlined in
43
+
Ansys Common Tools follows the PEP8 standard as outlined in
48
44
`PEP 8 <https://dev.docs.pyansys.com/coding-style/pep8.html>`_ in
49
45
the *PyAnsys developer's guide* and implements style checking using
50
46
`pre-commit <https://pre-commit.com/>`_.
@@ -76,7 +72,7 @@ This way, it's not possible for you to push code that fails the style checks::
76
72
Build the documentation
77
73
-----------------------
78
74
79
-
You can build the Ansys tools common documentation locally.
75
+
You can build Ansys Common Tools documentation locally.
80
76
81
77
#. Prior to building the documentation, you must run this command to install
82
78
documentation dependencies::
@@ -105,11 +101,10 @@ You can clean the documentation build by running this command::
105
101
Post issues
106
102
-----------
107
103
108
-
Use the `Ansys tools common Issues <https://github.com/ansys/ansys-tools-common/issues>`_
109
-
page to report bugs and request new features. When possible, use the issue templates provided.
104
+
Use the Ansys Common Tools `Issues <https://github.com/ansys/ansys-tools-common/issues>`_ page to report bugs and request new features. When possible, use the issue templates provided.
110
105
If your issue does not fit into one of these templates, click the link for opening a blank issue.
111
106
112
107
If you have general questions about the PyAnsys ecosystem, email
Copy file name to clipboardExpand all lines: doc/source/user_guide/ansys_downloader.rst
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,7 @@
3
3
Ansys example downloader
4
4
========================
5
5
6
-
You can use any of the functions available in the
7
-
to identify the path of the local Ansys installation.
8
-
9
-
For example you can use :func:`find_ansys <ansys.tools.common.path.find_ansys>`
10
-
to locate the path of the latest Ansys installation available:
6
+
Use the Ansys example downloader to download an example from a PyAnsys library. Import this tool and then specify the filename, directory, and local path for the file to download:
Copy file name to clipboardExpand all lines: doc/source/user_guide/ansys_exceptions.rst
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,24 +3,32 @@
3
3
Ansys exceptions
4
4
================
5
5
6
-
The Ansys exceptions tool provides a way to handle exceptions that may occur when using Ansys tools.
7
-
It allows you to catch specific exceptions and handle them gracefully, providing a better user experience.
6
+
Ansys exceptions are a set of predefined error-handling classes designed to help developers identify, catch, and handle errors that might occur when using Ansys tools. These exceptions provide a structured way to manage errors, ensuring that your programs can gracefully recover from unexpected issues and provide meaningful feedback to users.
8
7
9
-
How to use
10
-
----------
8
+
By using Ansys exceptions, you can improve the robustness and maintainability of your code. They allow you to differentiate between various types of errors, such as invalid input types or logical inconsistencies, and handle them appropriately.
11
9
12
-
You can use the `AnsysException` class to catch exceptions related to Ansys tools.
13
-
14
-
For example, you can use it to extend your exceptions or use them directly on your programs:
10
+
You can import exception classes and use the predefined exceptions directly in your programs:
15
11
16
12
.. code:: pycon
17
13
18
14
>>> from ansys.tools.exceptions import AnsysError
19
15
>>> from ansys.tools.exceptions import AnsysTypeError
20
16
>>> from ansys.tools.exceptions import AnsysLogicError
21
17
>>> raise AnsysError("An error occurred in Ansys tools.")
22
-
AnsysError: An error occurred in Ansys tools.
18
+
AnsysError: An error occurred in Ansys tools.
23
19
>>> raise AnsysTypeError("An invalid type was provided.")
24
20
AnsysTypeError: An invalid type was provided.
25
21
>>> raise AnsysLogicError("A logic error occurred in Ansys tools.")
26
22
AnsysLogicError: A logic error occurred in Ansys tools.
23
+
24
+
You can also extend the base exception class to define your own custom exceptions. This allows you to create error types specific to your needs:
25
+
26
+
.. code:: python
27
+
28
+
classCustomError(AnsysError):
29
+
"""A custom exception for specific error handling."""
30
+
31
+
pass
32
+
33
+
34
+
raise CustomError("This is a custom error message.")
Copy file name to clipboardExpand all lines: doc/source/user_guide/ansys_tools_path.rst
+3-12Lines changed: 3 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,9 @@
1
1
.. _ref_ansys_tools_path:
2
2
3
-
Ansys pathing tool
4
-
==================
3
+
Ansys path tool
4
+
===============
5
5
6
-
The Ansys pathing tool provides a way to identify the path of the local Ansys installation.
7
-
8
-
How to use
9
-
----------
10
-
11
-
You can use any of the functions available in the
12
-
to identify the path of the local Ansys installation.
13
-
14
-
For example you can use :func:`find_ansys <ansys.tools.common.path.find_ansys>`
15
-
to locate the path of the latest Ansys installation available:
6
+
Use the Ansys path tool to find the path of the latest local Ansys installation. Importing this tool and then call the :func:`find_ansys <ansys.tools.common.path.find_ansys>` function to return the installation path:
0 commit comments