Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/45.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update docstrings.
5 changes: 4 additions & 1 deletion src/ansys/tools/common/example_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ def _joinurl(self, base: str, directory: str) -> str:
Parameters
----------
base : str
Base URL to which the paths will be appended.
Base URL to which the directory path will be appended.
If it doesn't end with '/', one will be added automatically.
directory : str
Directory path to append to the base URL.

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def enable_output(self, stream=None):

Parameters
----------
stream: TextIO, default: ``sys.stderr``
stream: TextIO, default: ``None``
Stream to output the log output to.

"""
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/common/path/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""
Tools to find/cache installed Ansys products.

WARNING: This is not concurrent-safe (multiple python processes might race on this data.)
WARNING: This is not concurrent-safe (multiple Python processes might race on this data.)
"""

from ansys.tools.common.path.path import (
Expand Down
6 changes: 3 additions & 3 deletions src/ansys/tools/common/path/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Convenience CLI to save path for ansys application in configuration."""
"""Convenience CLI to save path for Ansys application in configuration."""

import click

Expand All @@ -40,14 +40,14 @@
"--allow-prompt",
is_flag=True,
default=False,
help="Allow prompt. Used in case a path is not given or the given path is not valid",
help="Allow prompt. Used in case a path is not given or the given path is not valid.",
)
def cli(
name: str,
location: str,
allow_prompt: bool,
):
"""CLI tool to store the path of a solver.
"""CLI tool to store the path of a product.

USAGE:

Expand Down
14 changes: 7 additions & 7 deletions src/ansys/tools/common/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,18 @@ def _is_ansys_var(self, env_var):
Parameters
----------
env_var : str
The environment variable to be evaluated.
The environment variable name to evaluate.

Returns
-------
bool
``True`` when successful, ``False`` when failed.
``True`` if the variable is identified as Ansys-related, ``False`` otherwise.
"""
# Loop over the Ansys default variables prefixes
for prefix in __ANSYS_VARS_PREFIX__:
# Check if the "prefix" substring is found
if env_var.startswith(prefix):
return True
if not isinstance(env_var, str):
return False

# Check if the variable starts with any known Ansys prefix
return any(env_var.startswith(prefix) for prefix in __ANSYS_VARS_PREFIX__)

def __repr__(self):
"""Print out the report.
Expand Down
Loading