Skip to content

Commit 4c7bc2e

Browse files
authored
Merge branch 'main' into docs/overall_review
2 parents 893faa0 + a1b4b6f commit 4c7bc2e

File tree

9 files changed

+28
-15
lines changed

9 files changed

+28
-15
lines changed

doc/changelog.d/38.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update supported version
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update docstrings.

doc/source/user_guide/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ User guide
77
This section explains key concepts for implementing its set of tools in your
88
PyAnsys workflows. You can use these tools in your examples as well as integrate Ansys Common Tools into your own code.
99

10+
.. important::
11+
This library only supports the last two major versions of Python. Usage with older
12+
versions might or might not work.
13+
14+
15+
1016
.. grid:: 1 2 2 2
1117

1218
.. grid-item-card:: Ansys path tool

doc/source/user_guide/report.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Report tool
44
===========
55

66
Use the Ansys report tool to generate reports. This tool includes the main
7-
:class:`Report <ansys.tools.common.report.Report>` class, which extends ``scooby.Report`` and customizes it to display Ansys libraries and variables in a common format.
7+
:class:`Report <ansys.tools.common.report.Report>` class, which extends
8+
``scooby.Report`` and customizes it to display Ansys libraries and
9+
variables in a common format.
810

9-
To import the package, run this command:
11+
To import the package, please run:
1012

1113
.. code:: python
1214

src/ansys/tools/common/example_download.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ def _joinurl(self, base: str, directory: str) -> str:
135135
Parameters
136136
----------
137137
base : str
138-
Base URL to which the paths will be appended.
138+
Base URL to which the directory path will be appended.
139+
If it doesn't end with '/', one will be added automatically.
140+
directory : str
141+
Directory path to append to the base URL.
139142
140143
Returns
141144
-------

src/ansys/tools/common/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def enable_output(self, stream=None):
9494
9595
Parameters
9696
----------
97-
stream: TextIO, default: ``sys.stderr``
97+
stream: TextIO, default: ``None``
9898
Stream to output the log output to.
9999
100100
"""

src/ansys/tools/common/path/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"""
2424
Tools to find/cache installed Ansys products.
2525
26-
WARNING: This is not concurrent-safe (multiple python processes might race on this data.)
26+
WARNING: This is not concurrent-safe (multiple Python processes might race on this data.)
2727
"""
2828

2929
from ansys.tools.common.path.path import (

src/ansys/tools/common/path/save.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222

23-
"""Convenience CLI to save path for ansys application in configuration."""
23+
"""Convenience CLI to save path for Ansys application in configuration."""
2424

2525
import click
2626

@@ -40,14 +40,14 @@
4040
"--allow-prompt",
4141
is_flag=True,
4242
default=False,
43-
help="Allow prompt. Used in case a path is not given or the given path is not valid",
43+
help="Allow prompt. Used in case a path is not given or the given path is not valid.",
4444
)
4545
def cli(
4646
name: str,
4747
location: str,
4848
allow_prompt: bool,
4949
):
50-
"""CLI tool to store the path of a solver.
50+
"""CLI tool to store the path of a product.
5151
5252
USAGE:
5353

src/ansys/tools/common/report.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,18 +228,18 @@ def _is_ansys_var(self, env_var):
228228
Parameters
229229
----------
230230
env_var : str
231-
The environment variable to be evaluated.
231+
The environment variable name to evaluate.
232232
233233
Returns
234234
-------
235235
bool
236-
``True`` when successful, ``False`` when failed.
236+
``True`` if the variable is identified as Ansys-related, ``False`` otherwise.
237237
"""
238-
# Loop over the Ansys default variables prefixes
239-
for prefix in __ANSYS_VARS_PREFIX__:
240-
# Check if the "prefix" substring is found
241-
if env_var.startswith(prefix):
242-
return True
238+
if not isinstance(env_var, str):
239+
return False
240+
241+
# Check if the variable starts with any known Ansys prefix
242+
return any(env_var.startswith(prefix) for prefix in __ANSYS_VARS_PREFIX__)
243243

244244
def __repr__(self):
245245
"""Print out the report.

0 commit comments

Comments
 (0)