Skip to content

Commit

Permalink
updated for phidl v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
atait committed Jan 23, 2020
1 parent 7ab9d26 commit 61d6a20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lytest/kdb_xor.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def xor_polygons_phidl(A, B, hash_geom=True):
all_layers.update(B_layers)
for layer in all_layers:
if (layer in A_layers) and (layer in B_layers):
p = gdspy.fast_boolean(operandA = A_polys[layer], operandB = B_polys[layer],
p = gdspy.fast_boolean(A_polys[layer], B_polys[layer],
operation = 'xor', precision=0.001,
max_points=4000, layer=layer[0], datatype=layer[1])
elif (layer in A_layers):
Expand All @@ -115,7 +115,7 @@ def run_xor_phidl(file1, file2, tolerance=1, verbose=False, hash_geom=True):
TOPS.append(import_oas(fn))
TOP1, TOP2 = TOPS
XOR = xor_polygons_phidl(TOP1, TOP2, hash_geom=True)
if len(XOR.elements) > 0:
if len(XOR.flatten().get_polygons()) > 0:
raise GeometryDifference("Differences found between layouts {} and {}".format(file1, file2))

# if you have failed to import klayout.db or pya, it's going to go slower but it can be done with phidl
Expand Down
6 changes: 3 additions & 3 deletions tests/phidl/test_phidl/test_1_phidldevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def test_phidlXOR():
TOP_different = phidlib.box(width=100)
for hash_geom in [True, False]:
XOR = xor_polygons_phidl(TOP1, TOP2, hash_geom=hash_geom)
if len(XOR.elements) > 0:
if len(XOR.flatten().get_polygons()) > 0:
raise GeometryDifference("Differences found between phidl Devices.")
XOR_different = xor_polygons_phidl(TOP_different, TOP2, hash_geom=hash_geom)
assert len(XOR_different.elements) > 0
assert len(XOR_different.flatten().get_polygons()) > 0


def test_OAS():
Expand All @@ -47,7 +47,7 @@ def test_OAS():
write_oas(TOP1, tempfilename)
TOP2 = import_oas(tempfilename)
XOR = xor_polygons_phidl(TOP1, TOP2)
if len(XOR.elements) > 0:
if len(XOR.flatten().get_polygons()) > 0:
raise GeometryDifference("Differences found between phidl Devices.")
os.remove(tempfilename)

0 comments on commit 61d6a20

Please sign in to comment.