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

Method rw_test

testdata/python/dbStreams.py:29–48  ·  view source on GitHub ↗
(self, format)

Source from the content-addressed store, hash-verified

27 # Full-spin read-write tests
28 # This test is rather a smoke test
29 def rw_test(self, format):
30
31 ly = pya.Layout()
32 cell = ly.create_cell("TOP")
33 l1 = ly.layer(1, 0)
34 cell.shapes(l1).insert(pya.Box(0, 0, 1000, 2000))
35 cell.shapes(l1).insert(pya.Box(-100, -200, 2000, 1000))
36 bbox = cell.bbox()
37
38 opt = pya.SaveLayoutOptions()
39 opt.format = format
40
41 b = ly.write_bytes(opt)
42
43 ly2 = pya.Layout()
44 ly2.read_bytes(b)
45
46 tc = ly.top_cell()
47 self.assertEqual(tc.name, "TOP")
48 self.assertEqual(str(tc.bbox()), str(bbox))
49
50 def test_gds2(self):
51 self.rw_test("GDS2")

Callers 5

test_gds2Method · 0.95
test_oasisMethod · 0.95
test_dxfMethod · 0.95
test_cifMethod · 0.95
test_lstreamMethod · 0.95

Calls 9

strFunction · 0.85
LayoutMethod · 0.80
SaveLayoutOptionsMethod · 0.80
write_bytesMethod · 0.80
create_cellMethod · 0.45
layerMethod · 0.45
insertMethod · 0.45
BoxMethod · 0.45
bboxMethod · 0.45

Tested by 5

test_gds2Method · 0.76
test_oasisMethod · 0.76
test_dxfMethod · 0.76
test_cifMethod · 0.76
test_lstreamMethod · 0.76