Skip to content

Commit

Permalink
test #84 done
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenb-dev committed Oct 29, 2024
1 parent df81705 commit a8a4608
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
19 changes: 16 additions & 3 deletions src/pyedb/grpc/edb_core/definition/padstack_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,22 @@ def hole_diameter(self):
@hole_diameter.setter
def hole_diameter(self, value):
hole_parameter = self.data.get_hole_parameters()
if hole_parameter[0].name.lower() == "padgeomtype_circle":
hole_parameter[1] = GrpcValue(value)
self.data.set_hole_parameters(hole_parameter)
if not isinstance(value, list):
value = [GrpcValue(value)]
else:
value = [GrpcValue(p) for p in value]
hole_size = value
geometry_type = hole_parameter[0]
hole_offset_x = hole_parameter[2]
hole_offset_y = hole_parameter[3]
hole_rotation = hole_parameter[4]
self.data.set_hole_parameters(
offset_x=hole_offset_x,
offset_y=hole_offset_y,
rotation=hole_rotation,
type_geom=geometry_type,
sizes=hole_size,
)

@property
def hole_offset_x(self):
Expand Down
10 changes: 4 additions & 6 deletions tests/grpc/system/test_edb_padstacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,12 @@ def test_update_padstacks_after_layer_name_changed(self, edb_examples):
assert padsatck_layers not in old_layers
edbapp.close_edb()

def test_hole(self):
source_path = os.path.join(local_path, "example_models", test_subfolder, "ANSYS-HSD_V1.aedb")
target_path = os.path.join(self.local_scratch.path, "test_padstack_def_update", "ANSYS-HSD_V1.aedb")
self.local_scratch.copyfolder(source_path, target_path)

edbapp = Edb(target_path, edbversion=desktop_version)
def test_hole(self, edb_examples):
# Done
edbapp = edb_examples.get_si_verse()
edbapp.padstacks.definitions["v35h15"].hole_diameter = "0.16mm"
assert edbapp.padstacks.definitions["v35h15"].hole_diameter == 0.00016
edbapp.close()

def test_padstack_instances_rtree_index(self):
source_path = os.path.join(local_path, "example_models", test_subfolder, "ANSYS-HSD_V1.aedb")
Expand Down

0 comments on commit a8a4608

Please sign in to comment.