Skip to content

Commit

Permalink
fix for PyPI and KLayout Application
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed Nov 18, 2023
1 parent 2cd4127 commit af549b3
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<klayout-macro>
<description>Double-bus ring resonator sweep (EBeam)</description>
<version/>
<category>pymacros</category>
<prolog/>
<epilog/>
<doc/>
<autorun>false</autorun>
<autorun-early>false</autorun-early>
<priority>0</priority>
<shortcut/>
<show-in-menu>true</show-in-menu>
<group-name>Examples_EBeam</group-name>
<menu-path>siepic_menu.exlayout.begin</menu-path>
<interpreter>python</interpreter>
<dsl-interpreter-name/>
<text>'''
# $description: Double-bus ring resonator sweep (EBeam)
# $show-in-menu
# $group-name: Examples_EBeam
# $menu-path: siepic_menu.exlayout.begin
# Unit testing for all library layout fixed cells and PCells

'''
Scripted layout for ring resonators using SiEPIC-Tools
in the SiEPIC-EBeam-PDK "EBeam" technology
by Lukas Chrostowski, 2020-2022
by Lukas Chrostowski, 2020-2023
'''

print('SiEPIC_EBeam_PDK: example_Ring_resonator_sweep.py')
import pya
from pya import *
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)


# Example layout function
def dbl_bus_ring_res():

# Import functions from SiEPIC-Tools
from SiEPIC.extend import to_itype
from SiEPIC.scripts import connect_cell, connect_pins_with_waveguide, zoom_out, export_layout
from SiEPIC.utils.layout import new_layout, floorplan

# Create a layout for testing a double-bus ring resonator.
# uses:
# - the SiEPIC EBeam Library
Expand Down Expand Up @@ -55,17 +63,12 @@ def dbl_bus_ring_res():
and Draw the floor plan
'''
tech_name = 'EBeam'
from SiEPIC.utils.layout import new_layout, floorplan
cell, ly = new_layout(tech_name, 'top', GUI=True, overwrite = True)
floorplan(cell, 605e3, 410e3)

if SiEPIC.__version__ &lt; '0.4.7':
if SiEPIC.__version__ < '0.4.7':
pya.MessageBox.warning("Errors", "This example requires SiEPIC-Tools version 0.4.7 or greater.", pya.MessageBox.Ok)

# Import functions from SiEPIC-Tools
from SiEPIC.extend import to_itype
from SiEPIC.scripts import connect_cell, connect_pins_with_waveguide

# Layer mapping:
LayerSiN = ly.layer(ly.TECHNOLOGY['Si'])
fpLayerN = cell.layout().layer(ly.TECHNOLOGY['FloorPlan'])
Expand Down Expand Up @@ -152,13 +155,12 @@ def dbl_bus_ring_res():
connect_pins_with_waveguide(instGCs[3], 'opt1', inst_dc2, 'pin3', waveguide_type=waveguide_type)

# Zoom out
from SiEPIC.scripts import zoom_out
zoom_out(cell)

from SiEPIC.scripts import export_layout
# Save
path = os.path.dirname(os.path.realpath(__file__))
export_layout(cell, path, 'Test_structures_ring_resonators', relative_path = '', format='oas', screenshot=True)

dbl_bus_ring_res()
</text>
</klayout-macro>

print('SiEPIC_EBeam_PDK: example_Ring_resonator_sweep.py - done')
3 changes: 3 additions & 0 deletions klayout/EBeam/pymacros/SiEPIC_EBeam_Library.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
Lukas 2021/04/01
- fixing loading library (previous collisions with other PDKs)
Lukas 2023/11
- compatibility with PyPI usage of KLayout
"""

Expand Down
3 changes: 3 additions & 0 deletions klayout/EBeam/pymacros/SiEPIC_EBeam_Library_Beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def PCell_get_parameters ( pcell ):
Lukas Chrostowski 2020/04/03
- SWG_assisted_Strip_WG based on SWG waveguide: adds a strip waveguide
Lukas 2023/11
- compatibility with PyPI usage of KLayout
todo:
replace:
Expand Down
1 change: 1 addition & 0 deletions klayout/EBeam/pymacros/SiEPIC_EBeam_Library_SiN.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- components for 1550 and 1310
- waveguides for 1550 and 1310
- compound waveguide
- compatibility with PyPI usage of KLayout
"""
print('siepic_ebeam_library_SiN')
Expand Down
3 changes: 2 additions & 1 deletion klayout/EBeam/pymacros/pcells_EBeam/Waveguide_Bend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pya import *
import pya

class Waveguide_Bend(PCellDeclarationHelper):
class Waveguide_Bend(pya.PCellDeclarationHelper):
"""
The PCell declaration for the waveguide bend.
"""
Expand Down
3 changes: 2 additions & 1 deletion klayout/EBeam/pymacros/pcells_EBeam/Waveguide_SBend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pya import *
import pya

class Waveguide_SBend(PCellDeclarationHelper):
class Waveguide_SBend(pya.PCellDeclarationHelper):
"""
Input:
"""
Expand Down
3 changes: 2 additions & 1 deletion klayout/EBeam/pymacros/pcells_EBeam/Waveguide_Straight.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pya import *
import pya

class Waveguide_Straight(PCellDeclarationHelper):
class Waveguide_Straight(pya.PCellDeclarationHelper):
"""
Input: length, width
draws a straight waveguide with pins. centred at the instantiation point.
Expand Down
3 changes: 2 additions & 1 deletion klayout/EBeam/pymacros/pcells_EBeam/Wireguide.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pya import *
import pya

class Wireguide(PCellDeclarationHelper):
class Wireguide(pya.PCellDeclarationHelper):
'''
RIT Integrated Photonics Group of Stefan Preble (Karl McNulty)
new wireguide class (essentially the metal path equivalent to a waveguide but no bend is allowed)
Expand Down
3 changes: 2 additions & 1 deletion klayout/EBeam/pymacros/pcells_EBeam/ebeam_bragg_te1550.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pya
from pya import *
import math
class ebeam_bragg_te1550(PCellDeclarationHelper):
class ebeam_bragg_te1550(pya.PCellDeclarationHelper):
"""
Input: length, width
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pya
from pya import *

class ebeam_dc_halfring_straight(PCellDeclarationHelper):
class ebeam_dc_halfring_straight(pya.PCellDeclarationHelper):
"""
The PCell declaration for the ebeam_dc_halfring_straight.
Consists of a half-ring with 1 waveguides.
Expand Down
3 changes: 2 additions & 1 deletion klayout/EBeam/pymacros/pcells_EBeam/ebeam_dc_te1550.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pya import *
import pya

class ebeam_dc_te1550(PCellDeclarationHelper):
class ebeam_dc_te1550(pya.PCellDeclarationHelper):
"""
The PCell declaration for the Directional Coupler
by Lukas Chrostowski, 2018/09
Expand Down
3 changes: 2 additions & 1 deletion klayout/EBeam/pymacros/pcells_EBeam/ebeam_taper_te1550.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pya
from pya import *

class ebeam_taper_te1550(PCellDeclarationHelper):
class ebeam_taper_te1550(pya.PCellDeclarationHelper):
"""
The PCell declaration for the strip waveguide taper.
"""
Expand Down
2 changes: 0 additions & 2 deletions klayout/EBeam/pymacros/pcells_EBeam/wg_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
class wg_heater(pya.PCellDeclarationHelper):

def __init__(self):
print('pcells_EBeam/wg_heater: __init__ start')

# Important: initialize the super class
super(wg_heater, self).__init__()

Expand Down

0 comments on commit af549b3

Please sign in to comment.