Skip to content

Commit 2615a70

Browse files
authored
REFACT: Clean design solution and circuit (#4561)
1 parent 90ec08f commit 2615a70

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pyaedt/application/design_solutions.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import copy
22

3+
from pyaedt.aedt_logger import pyaedt_logger as logger
34
from pyaedt.generic.general_methods import pyaedt_function_handler
45

56
solutions_defaults = {
@@ -549,7 +550,8 @@ def __init__(self, odesign, design_type, aedt_version):
549550
self._odesign = odesign
550551
self._aedt_version = aedt_version
551552
self.model_name = model_names[design_type]
552-
assert design_type in solutions_types, "Wrong Design Type"
553+
if not design_type in solutions_types:
554+
raise ValueError("Design type is not valid.")
553555
# deepcopy doesn't work on remote
554556
self._solution_options = copy.deepcopy(solutions_types[design_type])
555557
self._design_type = design_type
@@ -844,7 +846,7 @@ def solution_type(self, value):
844846
opts = ""
845847
self._odesign.SetSolutionType(self._solution_options[self._solution_type]["name"], opts)
846848
except Exception:
847-
pass
849+
logger.error("Failed to set solution type.")
848850

849851

850852
class IcepakDesignSolution(DesignSolution, object):
@@ -922,7 +924,7 @@ def solution_type(self, solution_type):
922924
try:
923925
self._odesign.SetSolutionType(options)
924926
except Exception:
925-
pass
927+
logger.error("Failed to set solution type.")
926928

927929

928930
class RmXprtDesignSolution(DesignSolution, object):
@@ -943,7 +945,7 @@ def solution_type(self, solution_type):
943945
self._odesign.SetDesignFlow(self._design_type, solution_type)
944946
self._solution_type = solution_type
945947
except Exception:
946-
pass
948+
logger.error("Failed to set design flow.")
947949

948950
@property
949951
def design_type(self):

pyaedt/circuit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def create_schematic_from_netlist(self, input_file):
214214
self[ppar] = pval
215215
xpos = 0.0254
216216
except Exception:
217-
pass
217+
self.logger.error("Failed to parse line '{}'.".format(line))
218218
elif ".model" in line[:7].lower() or ".lib" in line[:4].lower():
219219
model.append(line)
220220
if model:

0 commit comments

Comments
 (0)