Skip to content

Commit c3b200c

Browse files
committed
Merge branch 'main' into grpc-transition-tracker-PR#967
2 parents f76f954 + 10bda00 commit c3b200c

File tree

13 files changed

+620
-311
lines changed

13 files changed

+620
-311
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies = [
3434
"pydantic>=2.6.4,<2.11",
3535
"Rtree >= 1.2.0",
3636
"toml == 0.10.2",
37+
"shapely",
3738
"scikit-rf",
3839
"ansys-edb-core",
3940
"ansys-api-edb",

src/pyedb/common/nets.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def plot(
2222
show=True,
2323
annotate_component_names=True,
2424
plot_vias=False,
25+
title=None,
2526
**kwargs,
2627
):
2728
"""Plot a Net to Matplotlib 2D Chart.
@@ -57,6 +58,9 @@ def plot(
5758
plot_vias : bool, optional
5859
Whether to plot vias (circular and rectangular) or not. This may impact in the plot computation time.
5960
Default is ``False``.
61+
title : str, optional
62+
Specify the default plot title. Is value is ``None`` the project name is assigned by default. Default value
63+
is ``None``.
6064
show : bool, optional
6165
Whether to show the plot or not. Default is `True`.
6266
@@ -95,7 +99,7 @@ def mirror_poly(poly):
9599

96100
start_time = time.time()
97101
if not nets:
98-
nets = list(self.nets.keys())
102+
nets = list(self._pedb.nets.nets.keys())
99103
if isinstance(nets, str):
100104
nets = [nets]
101105
if not layers:
@@ -395,7 +399,12 @@ def create_poly(prim, polys, lines):
395399
# Hide axes ticks
396400
ax.set_xticks([])
397401
ax.set_yticks([])
398-
message = "Edb Top View" if top_view else "Edb Bottom View"
402+
if not title:
403+
if not self._pedb.grpc:
404+
title = self._pedb.active_cell.GetName()
405+
else:
406+
title = self._pedb.active_cell.name
407+
message = f"Edb Top View {title}" if top_view else f"Edb Bottom View {title}"
399408
plt.title(message, size=20)
400409
if show_legend:
401410
plt.legend(loc="upper left", fontsize="x-large")

src/pyedb/grpc/database/definition/materials.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import logging
2727
import os
2828
import re
29-
from typing import Optional
29+
from typing import Optional, Union
3030
import warnings
3131

3232
from ansys.edb.core.definition.debye_model import DebyeModel as GrpcDebyeModel
@@ -1205,3 +1205,18 @@ def read_syslib_material(self, material_name):
12051205

12061206
self.__edb.logger.error(f"Material {material_name} does not exist in syslib AMAT file.")
12071207
return res
1208+
1209+
def update_materials_from_sys_library(self, update_all: bool = True, material_name: Union[str, list] = None):
1210+
"""Update material properties from syslib AMAT file."""
1211+
amat_file = os.path.join(self.__edb.base_path, "syslib", "Materials.amat")
1212+
materials_dict = self.read_materials(amat_file)
1213+
if update_all:
1214+
for name, obj in self.materials.items():
1215+
if name in materials_dict:
1216+
obj.update(materials_dict[name])
1217+
self.__edb.logger.info(f"Material {name} is updated from syslibrary.")
1218+
else:
1219+
material_names = material_name if isinstance(material_name, list) else [material_name]
1220+
for name in material_names:
1221+
self.materials[name].update(materials_dict[name])
1222+
self.__edb.logger.info(f"Material {name} is updated from syslibrary.")

src/pyedb/grpc/database/layout/layout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ def primitives(self):
8181
prims.append(Circle(self._pedb, prim))
8282
elif isinstance(prim, ansys.edb.core.primitive.primitive.Bondwire):
8383
prims.append(Bondwire(self._pedb, prim))
84-
else:
85-
raise "Not valid primitive."
8684
return prims
8785

8886
@property

0 commit comments

Comments
 (0)