MCPcopy Create free account
hub / github.com/KLayout/klayout / test_10

Method test_10

testdata/python/dbLayoutTest.py:980–1064  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

978
979 # Instance editing
980 def test_10(self):
981
982 ly = pya.Layout()
983
984 ci1 = ly.add_cell("c1")
985 ci2 = ly.add_cell("c2")
986 ci3 = ly.add_cell("c3")
987
988 c1 = ly.cell(ci1)
989 c2 = ly.cell(ci2)
990 c3 = ly.cell(ci3)
991
992 tr = pya.Trans(pya.Trans.R90, pya.Point(100, -50))
993 i1 = c1.insert(pya.CellInstArray(c2.cell_index(), tr))
994
995 sv = []
996 for i in c1.each_inst():
997 sv.append(i.to_s(True))
998 self.assertEqual(";".join(sv), "c2 r90 100,-50")
999
1000 sv = []
1001 for i in c2.each_inst():
1002 sv.append(i.to_s(True))
1003 self.assertEqual(";".join(sv), "")
1004
1005 sv = []
1006 for i in c3.each_inst():
1007 sv.append(i.to_s(True))
1008 self.assertEqual(";".join(sv), "")
1009
1010 if ly.is_editable():
1011
1012 i1.cell_index = ci3
1013
1014 sv = []
1015 for i in c1.each_inst():
1016 sv.append(i.to_s(True))
1017 self.assertEqual(";".join(sv), "c3 r90 100,-50")
1018
1019 sv = []
1020 for i in c2.each_inst():
1021 sv.append(i.to_s(True))
1022 self.assertEqual(";".join(sv), "")
1023
1024 sv = []
1025 for i in c3.each_inst():
1026 sv.append(i.to_s(True))
1027 self.assertEqual(";".join(sv), "")
1028
1029 i1.cell = c2
1030
1031 sv = []
1032 for i in c1.each_inst():
1033 sv.append(i.to_s(True))
1034 self.assertEqual(";".join(sv), "c2 r90 100,-50")
1035
1036 sv = []
1037 for i in c2.each_inst():

Callers

nothing calls this directly

Calls 10

add_cellMethod · 0.95
LayoutMethod · 0.80
cellMethod · 0.45
PointMethod · 0.45
insertMethod · 0.45
cell_indexMethod · 0.45
appendMethod · 0.45
to_sMethod · 0.45
joinMethod · 0.45
is_editableMethod · 0.45

Tested by

no test coverage detected