Skip to content

Commit

Permalink
test #59 done
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenb-dev committed Oct 23, 2024
1 parent ecf555e commit 1b76ec5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/pyedb/grpc/edb_core/modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def primitives_by_layer(self):
for i in self._layout.primitives:
lay = i.layer.name
if lay in _primitives_by_layer:
_primitives_by_layer[lay].append(i)
_primitives_by_layer[lay].append(Primitive(self._pedb, i))
return _primitives_by_layer

@property
Expand All @@ -232,7 +232,7 @@ def rectangles(self):
List of rectangles.
"""
return [Rectangle(self._pedb, i) for i in self.primitives if i.primitive_type.name == "RECTANGLE"]
return [Rectangle(self._pedb, i) for i in self.primitives if i.type == "rectangle"]

@property
def circles(self):
Expand All @@ -244,7 +244,7 @@ def circles(self):
List of circles.
"""
return [Circle(self._pedb, i) for i in self.primitives if i.primitive_type.name == "CIRCLE"]
return [Circle(self._pedb, i) for i in self.primitives if i.type == "circle"]

@property
def paths(self):
Expand All @@ -255,7 +255,7 @@ def paths(self):
list of :class:`pyedb.dotnet.edb_core.edb_data.primitives_data.Primitive`
List of paths.
"""
return [Path(self._pedb, i) for i in self.primitives if i.primitive_type.name == "PATH"]
return [Path(self._pedb, i) for i in self.primitives if i.type == "path"]

@property
def polygons(self):
Expand All @@ -266,7 +266,7 @@ def polygons(self):
list of :class:`pyedb.dotnet.edb_core.edb_data.primitives_data.Primitive`
List of polygons.
"""
return [Polygon(self._pedb, i) for i in self.primitives if i.primitive_type.name == "POLYGON"]
return [Polygon(self._pedb, i) for i in self.primitives if i.type == "polygon"]

def get_polygons_by_layer(self, layer_name, net_list=None):
"""Retrieve polygons by a layer.
Expand Down
28 changes: 16 additions & 12 deletions tests/grpc/system/test_edb_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,23 @@ def test_modeler_paths(self, edb_examples):
assert edbapp.modeler["poly_3022"].type == "polygon"
edbapp.close()

def test_modeler_primitives_by_layer(self):
def test_modeler_primitives_by_layer(self, edb_examples):
"""Evaluate modeler primitives by layer"""
assert self.edbapp.modeler.primitives_by_layer["1_Top"][0].layer_name == "1_Top"
assert not self.edbapp.modeler.primitives_by_layer["1_Top"][0].is_negative
assert not self.edbapp.modeler.primitives_by_layer["1_Top"][0].is_void
self.edbapp.modeler.primitives_by_layer["1_Top"][0].is_negative = True
assert self.edbapp.modeler.primitives_by_layer["1_Top"][0].is_negative
self.edbapp.modeler.primitives_by_layer["1_Top"][0].is_negative = False
assert not self.edbapp.modeler.primitives_by_layer["1_Top"][0].has_voids
assert not self.edbapp.modeler.primitives_by_layer["1_Top"][0].is_parameterized
assert isinstance(self.edbapp.modeler.primitives_by_layer["1_Top"][0].get_hfss_prop(), tuple)
assert not self.edbapp.modeler.primitives_by_layer["1_Top"][0].is_zone_primitive
assert self.edbapp.modeler.primitives_by_layer["1_Top"][0].can_be_zone_primitive
# Done
edbapp = edb_examples.get_si_verse()
primmitive = edbapp.modeler.primitives_by_layer["1_Top"][0]
assert primmitive.layer_name == "1_Top"
assert not primmitive.is_negative
assert not primmitive.is_void
primmitive.is_negative = True
assert primmitive.is_negative
primmitive.is_negative = False
assert not primmitive.has_voids
assert not primmitive.is_parameterized
# assert isinstance(primmitive.get_hfss_prop(), tuple)
assert not primmitive.is_zone_primitive
assert primmitive.can_be_zone_primitive
edbapp.close()

def test_modeler_primitives(self):
"""Evaluate modeler primitives"""
Expand Down

0 comments on commit 1b76ec5

Please sign in to comment.