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

Method test_2

testdata/python/dbPCells.py:446–478  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

444
445
446 def test_2(self):
447
448 # instantiate and register the library
449 tl = PCellTestLib()
450
451 ly = pya.Layout(True)
452 ly.dbu = 0.01
453
454 ci1 = ly.add_cell("c1")
455 c1 = ly.cell(ci1)
456
457 lib = pya.Library.library_by_name("PCellTestLib")
458 pcell_decl_id = lib.layout().pcell_id("Box")
459
460 param = [ pya.LayerInfo(1, 0), 10.0, 2.0 ]
461 pcell_var_id = ly.add_pcell_variant(lib, pcell_decl_id, param)
462 pcell_var = ly.cell(pcell_var_id)
463 pcell_inst = c1.insert(pya.CellInstArray(pcell_var_id, pya.Trans()))
464
465 li1 = find_layer(ly, "1/0")
466 self.assertEqual(li1 != None, True)
467 self.assertEqual(ly.is_valid_layer(li1), True)
468 self.assertEqual(str(ly.get_info(li1)), "1/0")
469
470 self.assertEqual(pcell_inst.is_pcell(), True)
471
472 self.assertEqual(ly.begin_shapes(pcell_inst.cell_index, li1).shape().__str__(), "box (-500,-100;500,100)")
473 pcell_inst.convert_to_static()
474 self.assertEqual(pcell_inst.is_pcell(), False)
475 self.assertEqual(ly.begin_shapes(pcell_inst.cell_index, li1).shape().__str__(), "box (-500,-100;500,100)")
476 pcell_inst.convert_to_static()
477 self.assertEqual(pcell_inst.is_pcell(), False)
478 self.assertEqual(ly.begin_shapes(pcell_inst.cell_index, li1).shape().__str__(), "box (-500,-100;500,100)")
479
480 def test_3(self):
481

Callers

nothing calls this directly

Calls 12

add_cellMethod · 0.95
strFunction · 0.85
LayoutMethod · 0.80
pcell_idMethod · 0.80
__str__Method · 0.80
PCellTestLibClass · 0.70
find_layerFunction · 0.70
cellMethod · 0.45
layoutMethod · 0.45
insertMethod · 0.45
is_pcellMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected