Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix netlist issues #3938

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pyaedt/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def __enter__(self):

def _get_number_from_string(self, stringval):
value = stringval[stringval.find("=") + 1 :].strip().replace("{", "").replace("}", "").replace(",", ".")
value = value.replace("µ", "u")
try:
float(value)
return value
Expand Down Expand Up @@ -206,8 +207,11 @@ def create_schematic_from_netlist(self, file_to_import):
line = line.decode("utf-8")
if ".param" in line[:7].lower():
try:
ppar = line[7:].split("=")[0]
pval = line[7:].split("=")[1]
param_line = " ".join(line[7:].split())
param_re = re.split("[ =]", param_line)

ppar = param_re[0]
pval = param_re[1]
self[ppar] = pval
xpos = 0.0254
except:
Expand Down Expand Up @@ -371,7 +375,7 @@ def create_schematic_from_netlist(self, file_to_import):
mycomp = self.modeler.schematic.create_voltage_pulse(
name, value, [xpos, ypos], use_instance_id_netlist=use_instance
)
elif fields[0][0] == "K":
elif fields[0][0].lower() == "k":
value = self._get_number_from_string(fields[3])
mycomp = self.modeler.schematic.create_coupling_inductors(
name, fields[1], fields[2], value, [xpos, ypos], use_instance_id_netlist=use_instance
Expand Down
Loading