Skip to content

Commit d51fe51

Browse files
authored
REFACTOR: Cleanup rmxprt and pyaedt.modules files (#4869)
1 parent b0181a5 commit d51fe51

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

pyaedt/modules/report_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def traces(self):
544544
for i in oo1:
545545
_traces.append(Trace(self._post.oreportsetup, "{}:{}:{}".format(self.plot_name, el, i)))
546546
except Exception:
547-
pass
547+
self._post._app.logger.debug("Something went wrong while processing element {}.".format(el))
548548
return _traces
549549

550550
@pyaedt_function_handler()

pyaedt/modules/solutions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3268,7 +3268,9 @@ def plotGeomInfo(self):
32683268
else:
32693269
nonmodel_faces.append(str(index))
32703270
except Exception:
3271-
pass
3271+
self._postprocessor.logger.debug(
3272+
"Something went wrong while processing surface {}.".format(index)
3273+
)
32723274
info.append("Surface")
32733275
if model_faces:
32743276
info.append("FacesList")

pyaedt/rmxprt.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ def get_prop_server(self, parameter_name):
5858
if parameter_name in parameter_list:
5959
prop_server = key
6060
break
61-
assert prop_server is not None, "Unknown parameter name {0} exists in component {1}.".format(
62-
prop_server, self.component
63-
)
61+
if prop_server is None:
62+
raise AssertionError(
63+
"Unknown parameter name {0} exists in component {1}.".format(prop_server, self.component)
64+
)
6465
return prop_server
6566

6667
def __init__(self, oeditor):
@@ -269,8 +270,8 @@ def __init__(
269270
)
270271
if not model_units or model_units == "mm":
271272
model_units = "mm"
272-
else:
273-
assert model_units == "in", "Invalid model units string {}".format(model_units)
273+
elif model_units != "in":
274+
raise AssertionError("Invalid model units string {}.".format(model_units))
274275
self.modeler.oeditor.SetMachineUnits(["NAME:Units Parameter", "Units:=", model_units, "Rescale:=", False])
275276
self.stator = Stator(self.modeler.oeditor)
276277
self.rotor = Rotor(self.modeler.oeditor)

0 commit comments

Comments
 (0)