Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions src/ansys/mapdl/core/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ def format_using_autopep8(self, text: str | None = None) -> str | None:
text : str, optional
Text to format instead of `self.lines`. For development use.

Returns
-------
str or None
The formatted text string, or None if no text provided.
"""
if self.cleanup_output:
try:
Expand Down
38 changes: 32 additions & 6 deletions src/ansys/mapdl/core/information.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class Information:
It is also the object that is called when you issue ``print(mapdl)``,
which means ``print`` calls ``mapdl.info.__str__()``.

Parameters
----------
mapdl : Mapdl
The MAPDL instance to get information from.

Notes
-----
You cannot directly modify the values of this class.
Expand Down Expand Up @@ -88,7 +93,8 @@ class Information:
"""

def __init__(self, mapdl: "Mapdl") -> None:
"""Class Initializer"""
"""Class Initializer
"""
from ansys.mapdl.core.mapdl import MapdlBase # lazy import to avoid circular

if not isinstance(mapdl, MapdlBase): # pragma: no cover
Expand All @@ -104,12 +110,14 @@ def __init__(self, mapdl: "Mapdl") -> None:

@property
def _mapdl(self) -> "Mapdl":
"""Return the weakly referenced MAPDL instance."""
"""Return the weakly referenced MAPDL instance.
"""
return self._mapdl_weakref()

def _update(self) -> None:
"""We might need to do more calls if we implement properties
that change over the MAPDL session."""
that change over the MAPDL session.
"""
try:
if self._mapdl._exited: # pragma: no cover
raise MapdlExitedError("Information class: MAPDL exited")
Expand Down Expand Up @@ -140,13 +148,25 @@ def __repr__(self) -> str:
@property
@update_information_first(False)
def product(self) -> str:
"""Retrieve the product from the MAPDL instance."""
"""Retrieve the product from the MAPDL instance.

Returns
-------
str
The product name.
"""
return self._get_product()

@property
@update_information_first(False)
def mapdl_version(self) -> str:
"""Retrieve the MAPDL version from the MAPDL instance."""
"""Retrieve the MAPDL version from the MAPDL instance.

Returns
-------
str
The MAPDL version string.
"""
return self._get_mapdl_version()

@property
Expand All @@ -173,7 +193,13 @@ def mapdl_version_update(self) -> str:
@property
@update_information_first(False)
def pymapdl_version(self) -> str:
"""Retrieve the PyMAPDL version from the MAPDL instance."""
"""Retrieve the PyMAPDL version from the MAPDL instance.

Returns
-------
str
The PyMAPDL version string.
"""
return self._get_pymapdl_version()

@property
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/mapdl/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def version_from_path(*args: Any, **kwargs: Any) -> int | None:
try:
os.makedirs(SETTINGS_DIR)
LOG.debug(f"Created settings directory: {SETTINGS_DIR}")
except:
except OSError:
warnings.warn(
"Unable to create settings directory.\n"
"Will be unable to cache MAPDL executable location"
Expand Down Expand Up @@ -379,7 +379,7 @@ def port_in_use_using_socket(port: int, host: str) -> bool:
try:
sock.bind((host, port))
return False
except:
except OSError:
return True


Expand Down
3 changes: 1 addition & 2 deletions src/ansys/mapdl/core/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ def _check_license_file_iterator(
"PyMAPDL is taking longer than expected to connect to an MAPDL session.\n"
"Checking if there are any available licenses..."
)
LOG.debug(msg)
print(msg)
LOG.info(msg)
notification_bool = False

msg = next(file_iterator)
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/mapdl_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3192,7 +3192,7 @@ def _get_file_name(
Parameters
----------
fname : str
File name (with our with extension). It can be a full path.
File name (with or without extension). It can be a full path.

ext : str, optional
File extension. The default is None.
Expand Down