Skip to content

Commit

Permalink
REFACT: Clean design solution and circuit (#4561)
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys authored Apr 22, 2024
1 parent 90ec08f commit 2615a70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions pyaedt/application/design_solutions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import copy

from pyaedt.aedt_logger import pyaedt_logger as logger
from pyaedt.generic.general_methods import pyaedt_function_handler

solutions_defaults = {
Expand Down Expand Up @@ -549,7 +550,8 @@ def __init__(self, odesign, design_type, aedt_version):
self._odesign = odesign
self._aedt_version = aedt_version
self.model_name = model_names[design_type]
assert design_type in solutions_types, "Wrong Design Type"
if not design_type in solutions_types:
raise ValueError("Design type is not valid.")
# deepcopy doesn't work on remote
self._solution_options = copy.deepcopy(solutions_types[design_type])
self._design_type = design_type
Expand Down Expand Up @@ -844,7 +846,7 @@ def solution_type(self, value):
opts = ""
self._odesign.SetSolutionType(self._solution_options[self._solution_type]["name"], opts)
except Exception:
pass
logger.error("Failed to set solution type.")


class IcepakDesignSolution(DesignSolution, object):
Expand Down Expand Up @@ -922,7 +924,7 @@ def solution_type(self, solution_type):
try:
self._odesign.SetSolutionType(options)
except Exception:
pass
logger.error("Failed to set solution type.")


class RmXprtDesignSolution(DesignSolution, object):
Expand All @@ -943,7 +945,7 @@ def solution_type(self, solution_type):
self._odesign.SetDesignFlow(self._design_type, solution_type)
self._solution_type = solution_type
except Exception:
pass
logger.error("Failed to set design flow.")

@property
def design_type(self):
Expand Down
2 changes: 1 addition & 1 deletion pyaedt/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def create_schematic_from_netlist(self, input_file):
self[ppar] = pval
xpos = 0.0254
except Exception:
pass
self.logger.error("Failed to parse line '{}'.".format(line))
elif ".model" in line[:7].lower() or ".lib" in line[:4].lower():
model.append(line)
if model:
Expand Down

0 comments on commit 2615a70

Please sign in to comment.