Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Thanks to @MaxJPRey

Co-authored-by: Maxime Rey <[email protected]>
  • Loading branch information
germa89 and MaxJPRey authored Jan 7, 2025
1 parent afc448e commit ad28f1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/ansys/mapdl/core/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def __repr__(self):
# If there is no result file, this fails.
try:
nsets = int(self.nsets)
except MapdlRuntimeError:
except MapdlRuntimeError as error:
self._mapdl.logger.debug(f"Error when obtaining the number of sets:\n{error}")
nsets = "NA"

info += f"\tNumber of result sets: {nsets}\n"
Expand All @@ -159,6 +160,7 @@ def __repr__(self):
"An error occurred while attempting to open the results file"
in str(err)
):
self._mapdl.logger.debug(f"List of steps could not be obtained due to error:\n{err}")
nlist = "Results file is not available"
else:
raise err
Expand Down
4 changes: 2 additions & 2 deletions tests/test_xpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def cube_solve(mapdl):

clear(mapdl)

# setup the full file
# set up the full file
mapdl.block(0, 1, 0, 1, 0, 1)
mapdl.et(1, 186)
mapdl.esize(0.5)
mapdl.vmesh("all")

# Define a material (nominal steel in SI)
mapdl.mp("EX", 1, 210e9) # Elastic moduli in Pa (kg/(m*s**2))
mapdl.mp("EX", 1, 210e9) # Elastic modulus in Pa (kg/(m*s**2))
mapdl.mp("DENS", 1, 7800) # Density in kg/m3
mapdl.mp("NUXY", 1, 0.3) # Poisson's Ratio

Expand Down

0 comments on commit ad28f1a

Please sign in to comment.