From a3178f52fcd9335e0f7c1925600a508d3605b356 Mon Sep 17 00:00:00 2001 From: jan Date: Thu, 31 Mar 2022 00:02:14 -0700 Subject: [PATCH] move example into a new dir --- example.py => examples/check.py | 8 ++++++-- connectivity.oas => examples/connectivity.oas | Bin 2 files changed, 6 insertions(+), 2 deletions(-) rename example.py => examples/check.py (74%) rename connectivity.oas => examples/connectivity.oas (100%) diff --git a/example.py b/examples/check.py similarity index 74% rename from example.py rename to examples/check.py index f21dd0f..846087b 100644 --- a/example.py +++ b/examples/check.py @@ -1,3 +1,7 @@ +""" +Example code for checking connectivity in a layout by using +`snarl` and `masque`. +""" from pprint import pformat from masque.file import gdsii, oasis @@ -17,11 +21,11 @@ connectivity = { cells, props = oasis.readfile('connectivity.oas') topcell = cells['top'] -polys, labels = snarl.interfaces.masque.read_topcell(topcell, connectivity) +polys, labels = snarl.interfaces.masque.read_cell(topcell, connectivity) nets_info = snarl.trace_connectivity(polys, labels, connectivity) print('\nFinal nets:') -print([kk for kk in nets_info.nets if isinstance(kk.name, str)]) +print([kk for kk in sorted(nets_info.nets.keys()) if isinstance(kk.name, str)]) print('\nShorted net sets:') for short in nets_info.get_shorted_nets(): diff --git a/connectivity.oas b/examples/connectivity.oas similarity index 100% rename from connectivity.oas rename to examples/connectivity.oas