From 665eabeabf7b5df259f08224684a9df156f72016 Mon Sep 17 00:00:00 2001 From: lukasc-ubc Date: Sat, 18 Nov 2023 16:39:19 -0800 Subject: [PATCH] Update example_Ring_resonator_sweep.py add verification to the example --- .../example_Ring_resonator_sweep.py | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/klayout/EBeam/pymacros/Example_scripted_layouts/example_Ring_resonator_sweep.py b/klayout/EBeam/pymacros/Example_scripted_layouts/example_Ring_resonator_sweep.py index 1644fddf..d79f0bc0 100644 --- a/klayout/EBeam/pymacros/Example_scripted_layouts/example_Ring_resonator_sweep.py +++ b/klayout/EBeam/pymacros/Example_scripted_layouts/example_Ring_resonator_sweep.py @@ -15,14 +15,20 @@ print('SiEPIC_EBeam_PDK: example_Ring_resonator_sweep.py') import pya from pya import * + +# SiEPIC - can be loaded from PyPI or in KLayout Application, or loaded from a local folder such as GitHub +import os, sys +path_GitHub = '/Users/lukasc/Documents/GitHub/' +if os.path.exists(path_GitHub): + path_siepic = os.path.join(path_GitHub, 'SiEPIC-Tools/klayout_dot_config/python') + if not path_siepic in sys.path: + sys.path.insert(0,path_siepic) # put SiEPIC at the beginning so that it is overrides the system-installed module import SiEPIC -import os from SiEPIC._globals import Python_Env from SiEPIC.scripts import load_klayout_technology if Python_Env == 'Script': - path_GitHub = '/Users/lukasc/Documents/GitHub/' path_module = os.path.join(path_GitHub, 'SiEPIC_EBeam_PDK/klayout') path_lyt_file = os.path.join(path_GitHub, 'SiEPIC_EBeam_PDK/klayout/EBeam/EBeam.lyt') tech = load_klayout_technology('EBeam', path_module, path_lyt_file) @@ -160,7 +166,15 @@ def dbl_bus_ring_res(): # Save path = os.path.dirname(os.path.realpath(__file__)) export_layout(cell, path, 'Test_structures_ring_resonators', relative_path = '', format='oas', screenshot=True) + + return ly, cell -dbl_bus_ring_res() +ly, cell = dbl_bus_ring_res() + +from SiEPIC.verification import layout_check +print('SiEPIC_EBeam_PDK: example_Ring_resonator_sweep.py - verification') + +layout_check(cell = cell, verbose=True, GUI=True) + print('SiEPIC_EBeam_PDK: example_Ring_resonator_sweep.py - done')