Skip to content

Commit

Permalink
REFACTOR: Fix to use component instead of bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Jun 14, 2024
1 parent 6acdd5f commit d2b50f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/pyedb/dotnet/edb_core/cell/hierarchy/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ def package_def(self, value):
comp_prop.SetPackageDef(package_def._edb_object)
self.edbcomponent.SetComponentProperty(comp_prop)

def create_package_def(self, name="", extent_bounding_box=None):
def create_package_def(self, name="", component_part_name=None):
"""Create a package definition and assign it to the component.
Parameters
----------
name: str, optional
Name of the package definition
extent_bounding_box : list, optional
Boundary points which define the shape of the package.
component_part_name : str, optional
Part name of the component.
Returns
-------
Expand All @@ -154,7 +154,7 @@ def create_package_def(self, name="", extent_bounding_box=None):
if not name:
name = "{}_{}".format(self.refdes, self.part_name)
if name not in self._pedb.definitions.package:
self._pedb.definitions.add_package_def(name, boundary_points=extent_bounding_box)
self._pedb.definitions.add_package_def(name, component_part_name=component_part_name)
self.package_def = name

from pyedb.dotnet.edb_core.dotnet.database import PolygonDataDotNet
Expand Down
6 changes: 2 additions & 4 deletions src/pyedb/dotnet/edb_core/definition/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def package(self):
"""Package definitions."""
return {l.GetName(): PackageDef(self._pedb, l) for l in list(self._pedb.active_db.PackageDefs)}

def add_package_def(self, name, component_part_name=None, boundary_points=None):
def add_package_def(self, name, component_part_name=None):
"""Add a package definition.
Parameters
Expand All @@ -47,14 +47,12 @@ def add_package_def(self, name, component_part_name=None, boundary_points=None):
Name of the package definition.
component_part_name : str, optional
Part name of the component.
boundary_points : list, optional
Boundary points which define the shape of the package.
Returns
-------
"""
package_def = PackageDef(
self._pedb, name=name, component_part_name=component_part_name, extent_bounding_box=boundary_points
self._pedb, name=name, component_part_name=component_part_name
)
return package_def
3 changes: 2 additions & 1 deletion tests/legacy/system/test_edb_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,10 @@ def test_instances(self):
assert edbapp.components.instances["Test"].center == [0.06800000116, 0.01649999875]
edbapp.close_edb()

@pytest.mark.current
def test_create_package_def(self):
"""Check the creation of package definition."""
assert self.edbapp.components["C200"].create_package_def(extent_bounding_box=[[0, 0], ["2mm", "2mm"]])
assert self.edbapp.components["C200"].create_package_def(component_part_name="SMTC-MECT-110-01-M-D-RA1_V")
assert not self.edbapp.components["C200"].create_package_def()
assert self.edbapp.components["C200"].package_def.name == "C200_CAPC3216X180X55ML20T25"

Expand Down

0 comments on commit d2b50f9

Please sign in to comment.