From cdf212510599077af7545e4a4849c4a14de16eef Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Tue, 29 Oct 2024 16:01:37 +0100 Subject: [PATCH] test #93 done --- src/pyedb/grpc/edb.py | 11 +++--- tests/conftest.py | 2 +- tests/grpc/system/test_edb.py | 67 +++++++++-------------------------- 3 files changed, 24 insertions(+), 56 deletions(-) diff --git a/src/pyedb/grpc/edb.py b/src/pyedb/grpc/edb.py index a4ba72b480..96969c48ca 100644 --- a/src/pyedb/grpc/edb.py +++ b/src/pyedb/grpc/edb.py @@ -1476,8 +1476,9 @@ def _create_convex_hull( p = insts[i].position pos_1 = [i - 1e-12 for i in p] pos_2 = [i + 1e-12 for i in p] - plane = self.modeler.Shape("rectangle", pointA=pos_1, pointB=pos_2) - rectangle_data = self.modeler.shape_to_polygon_data(plane) + pos_3 = [pos_2[0], pos_1[1]] + pos_4 = pos_1[0], pos_2[1] + rectangle_data = GrpcPolygonData(points=[pos_1, pos_3, pos_2, pos_4]) _polys.append(rectangle_data) for prim in self.modeler.primitives: if not prim.is_null and not prim.net.is_null: @@ -1890,13 +1891,13 @@ def _create_cutout_multithread( "SParameterModel", "NetlistModel", ] and list(set(el.nets[:]) & set(signal_list[:])): - pins_to_preserve.extend([i.id for i in el.pins.values()]) + pins_to_preserve.extend([i.edb_uid for i in el.pins.values()]) nets_to_preserve.extend(el.nets) if include_pingroups: for pingroup in self.layout.pin_groups: for pin in pingroup.pins.values(): if pin.net_name in reference_list: - pins_to_preserve.append(pin.id) + pins_to_preserve.append(pin.edb_uid) if check_terminals: terms = [ term for term in self.layout.terminals if term.boundary_type in get_terminal_supported_boundary_types() @@ -1904,7 +1905,7 @@ def _create_cutout_multithread( for term in terms: if isinstance(term, PadstackInstanceTerminal): if term.net.name in reference_list: - pins_to_preserve.append(term.id) + pins_to_preserve.append(term.edb_uid) for i in self.nets.nets.values(): name = i.name diff --git a/tests/conftest.py b/tests/conftest.py index 60609be985..0ddbf4fa2d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -56,7 +56,7 @@ local_path = os.path.dirname(os.path.realpath(__file__)) # Initialize default desktop configuration -desktop_version = "2024.2" +desktop_version = "2025.2" if "ANSYSEM_ROOT{}".format(desktop_version[2:].replace(".", "")) not in list_installed_ansysem(): desktop_version = list_installed_ansysem()[0][12:].replace(".", "") desktop_version = "20{}.{}".format(desktop_version[:2], desktop_version[-1]) diff --git a/tests/grpc/system/test_edb.py b/tests/grpc/system/test_edb.py index edb6d2edd5..327d23bdff 100644 --- a/tests/grpc/system/test_edb.py +++ b/tests/grpc/system/test_edb.py @@ -336,56 +336,23 @@ def test_create_custom_cutout_3(self, edb_examples): def test_create_custom_cutout_4(self, edb_examples): """Create custom cutout 4.""" - pass - # edbapp = edb_examples.get_si_verse() - # edbapp.components.create_pingroup_from_pins( - # [i for i in list(edbapp.components.instances["U1"].pins.values()) if i.net_name == "GND"] - # ) - # - # assert edbapp.cutout( - # signal_list=["DDR4_DQS0_P", "DDR4_DQS0_N"], - # reference_list=["GND"], - # number_of_threads=4, - # extent_type="ConvexHull", - # use_pyaedt_extent_computing=True, - # include_pingroups=True, - # check_terminals=True, - # expansion_factor=4, - # ) - # edbapp.close() - # source_path = os.path.join(local_path, "example_models", test_subfolder, "MicrostripSpliGnd.aedb") - # target_path = os.path.join(self.local_scratch.path, "MicrostripSpliGnd.aedb") - # self.local_scratch.copyfolder(source_path, target_path) - # - # edbapp = Edb(target_path, edbversion=desktop_version, restart_rpc_server=True) - # - # assert edbapp.cutout( - # signal_list=["trace_n"], - # reference_list=["ground"], - # number_of_threads=4, - # extent_type="Conformal", - # use_pyaedt_extent_computing=True, - # check_terminals=True, - # expansion_factor=2, - # include_voids_in_extents=True, - # ) - # edbapp.close() - # source_path = os.path.join(local_path, "example_models", test_subfolder, "Multizone_GroundVoids.aedb") - # target_path = os.path.join(self.local_scratch.path, "Multizone_GroundVoids.aedb") - # self.local_scratch.copyfolder(source_path, target_path) - # - # edbapp = Edb(target_path, edbversion=desktop_version) - # - # assert edbapp.cutout( - # signal_list=["DIFF_N", "DIFF_P"], - # reference_list=["GND"], - # number_of_threads=4, - # extent_type="Conformal", - # use_pyaedt_extent_computing=True, - # check_terminals=True, - # expansion_factor=3, - # ) - # edbapp.close() + # Done + edbapp = edb_examples.get_si_verse() + edbapp.components.create_pingroup_from_pins( + [i for i in list(edbapp.components.instances["U1"].pins.values()) if i.net_name == "GND"] + ) + + assert edbapp.cutout( + signal_list=["DDR4_DQS0_P", "DDR4_DQS0_N"], + reference_list=["GND"], + number_of_threads=4, + extent_type="ConvexHull", + use_pyaedt_extent_computing=True, + include_pingroups=True, + check_terminals=True, + expansion_factor=4, + ) + edbapp.close() def test_export_to_hfss(self): """Export EDB to HFSS."""