Skip to content

Commit

Permalink
v0.5.14
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed Oct 19, 2024
1 parent 2fbbc75 commit b7c4e42
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion klayout_dot_config/grain.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<salt-grain>
<name>siepic_tools</name>
<version>0.5.13</version>
<version>0.5.14</version>
<api-version>0.27</api-version>
<title>SiEPIC Tools</title>
<doc>Tools for designing Silicon Photonic Integrated Circuits, including waveguides, component simulations, functional verification, DRC verification, Functional verification, netlist extraction, circuit simulations. Layout can be implemented graphically or by programming in Python using the SiEPIC functions and KLayout Python API. Framework and examples for creating layouts using scripts. Includes a generic PDK (GSiP). Other PDKs are installed separately, and depend on SiEPIC-Tools.</doc>
Expand Down
2 changes: 1 addition & 1 deletion klayout_dot_config/python/SiEPIC/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SiEPIC-Tools package for KLayout
'''

__version__ = "0.5.13"
__version__ = "0.5.14"

print("KLayout SiEPIC-Tools version %s" %__version__)

Expand Down
36 changes: 29 additions & 7 deletions klayout_dot_config/python/SiEPIC/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3484,7 +3484,7 @@ def import_module_from_path(module_name, file_path):
importlib.invalidate_caches()

# Import the Python folder as a module
folder_pcell_abs = os.path.join(tech.default_base_path, folder_pcell)
folder_pcell_abs = os.path.abspath(os.path.join(tech.default_base_path, folder_pcell))
module_name = os.path.split(folder_pcell)[-1]
if verbose:
print(' - PCell module name: %s' % module_name)
Expand Down Expand Up @@ -3528,20 +3528,27 @@ def __init__(self):
# Import all the GDS/OASIS files from the tech folder
if folder_gds:
import os, fnmatch
dir_path = os.path.join(tech.default_base_path, folder_gds)
dir_path = os.path.abspath(os.path.join(tech.default_base_path, folder_gds))
if verbose:
print(' - GDS/OAS folder path: %s' % dir_path)
search_strs = ['*.[Oo][Aa][Ss]', '*.[Gg][Dd][Ss]'] # OAS, GDS
found = False
for search_str in search_strs:
for root, dirnames, filenames in os.walk(dir_path, followlinks=True):
for filename in fnmatch.filter(filenames, search_str):
file1=os.path.join(root, filename)
if verbose:
print(" - reading %s" % filename )
self.layout().read(file1)
found = True
if not found:
print(' - Warning: no fixed GDS/OAS files found for library: %s, in folder: %s' % (library_name, dir_path))


# Create the PCell declarations
if folder_pcell:
if not pcells_:
print(' - Warning: no PCells found for library: %s' % library_name)
for m in pcells_:
mm = m.__name__.replace('%s.' % module_name,'')
# mm2 = m.__name__+'.'+mm+'()'
Expand All @@ -3562,19 +3569,34 @@ def __init__(self):

return library_name

def technology_libraries(tech):
def technology_libraries(technology):
'''
Function to get a list of all the pya.Library associated with a pya.Technology
missing in KLayout: https://github.com/KLayout/klayout/issues/879
https://www.klayout.de/doc-qt5/code/class_Technology.html
Inputs:
technology: name of the technology, e.g., "EBeam", or pya.Technology
'''
import pya

if type(technology) == str:
tech = pya.Technology.technology_by_name(technology)
if not tech:
raise Exception('SiEPIC.load_klayout_library cannot load technology: %s' % technology)
tech_name = technology
elif type(technology) == pya.Technology:
tech = technology
if not tech:
raise Exception('SiEPIC.load_klayout_library cannot load technology: %s' % technology)
tech_name = technology.name
else:
raise Exception('SiEPIC.load_klayout_library requires a technology as input.')

tech_libs = []
libs = pya.Library.library_ids()
for lib in libs:
l = pya.Library.library_by_id(lib)
if tech in l.technologies():
if tech_name in l.technologies():
tech_libs.append(l.name())
#print("%s" % (l.name()))
print('Libraries associated with Technology %s: %s' % (tech, tech_libs))

print('Libraries associated with Technology %s: %s' % (tech_name, tech_libs))

2 changes: 1 addition & 1 deletion klayout_dot_config/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "SiEPIC"
version = "0.5.13"
version = "0.5.14"
authors = [
{ name="Lukas Chrostowski", email="[email protected]" },
]
Expand Down

0 comments on commit b7c4e42

Please sign in to comment.