From ad28f1ae54470429455d299d9483a2693b1e8747 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:42:47 +0100 Subject: [PATCH] Apply suggestions from code review Thanks to @MaxJPRey Co-authored-by: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> --- src/ansys/mapdl/core/post.py | 4 +++- tests/test_xpl.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ansys/mapdl/core/post.py b/src/ansys/mapdl/core/post.py index 7c0ee31fdc..4f335b95bf 100644 --- a/src/ansys/mapdl/core/post.py +++ b/src/ansys/mapdl/core/post.py @@ -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" @@ -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 diff --git a/tests/test_xpl.py b/tests/test_xpl.py index 082f30fdfc..94e3050a85 100644 --- a/tests/test_xpl.py +++ b/tests/test_xpl.py @@ -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