Skip to content

Commit 0b49910

Browse files
authored
Merge branch 'main' into feat/tech
2 parents 371badf + 8c05672 commit 0b49910

File tree

6 files changed

+17
-13
lines changed

6 files changed

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

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
@@ -125,7 +125,7 @@ def enable_output(self, stream=None):
125125
126126
Parameters
127127
----------
128-
stream: TextIO, default: ``sys.stderr``
128+
stream: TextIO, default: ``None``
129129
Stream to output the log output to.
130130
131131
"""

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)