Skip to content

Commit

Permalink
Update _globals.py to get rid of qwidget error
Browse files Browse the repository at this point in the history
  • Loading branch information
jasminabrar authored Nov 23, 2023
1 parent aacef36 commit 30d6242
Showing 1 changed file with 49 additions and 50 deletions.
99 changes: 49 additions & 50 deletions klayout_dot_config/python/SiEPIC/_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,73 +20,72 @@
from .core import WaveguideGUI, MonteCarloGUI, Net, Component
'''
# Netlist extraction will merge straight+bend sections into waveguide (1),
# or extract each bend, straight section, etc. (0)
#WAVEGUIDE_extract_simple = 1
SIMPLIFY_NETLIST_EXTRACTION = True

if Python_Env == "KLayout_GUI":
# Netlist extraction will merge straight+bend sections into waveguide (1),
# or extract each bend, straight section, etc. (0)
#WAVEGUIDE_extract_simple = 1
SIMPLIFY_NETLIST_EXTRACTION = True

# Create GUI's
from .core import WaveguideGUI, MonteCarloGUI
WG_GUI = WaveguideGUI()
MC_GUI = MonteCarloGUI()



# ******** lukasc
# don't use a global one.. based on cells
# Define global Net object that implements netlists and pin searching/connecting
# NET = Net()
# ******** lukasc
# don't use a global one.. based on cells
# Define global Net object that implements netlists and pin searching/connecting
# NET = Net()
if Python_Env == "KLayout_GUI":
from .core import Net, Component
NET_DISCONNECTED = Net()

# don't use a global one.. based on cells
# Define global Component object
#COMPONENT = Component()


# Define an Enumeration type for Python
# TODO: maybe move to standard enum for python3
# https://docs.python.org/3/library/enum.html
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)

# Define enumeration for pins
PIN_TYPES = enum('OPTICALIO', 'OPTICAL', 'ELECTRICAL')
PIN_LENGTH = 20 # 10 nm on each side. Previous was 2x50 nm, but shorter works well for Waveguide DRC checking


MODULE_NUMPY = False

# don't use a global one.. based on cells
# Define global Component object
#COMPONENT = Component()


# Define an Enumeration type for Python
# TODO: maybe move to standard enum for python3
# https://docs.python.org/3/library/enum.html
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)

# Define enumeration for pins
PIN_TYPES = enum('OPTICALIO', 'OPTICAL', 'ELECTRICAL')
PIN_LENGTH = 20 # 10 nm on each side. Previous was 2x50 nm, but shorter works well for Waveguide DRC checking


MODULE_NUMPY = False
try:
import numpy
MODULE_NUMPY = True
except ImportError:
from .install import install_numpy
try:

import numpy
MODULE_NUMPY = True
except ImportError:
from .install import install_numpy
try:

import numpy
MODULE_NUMPY = True
except ImportError:
from .install import install_numpy
try:
MODULE_NUMPY = install_numpy()
except Exception as e:
print("Could not install numpy with pip. ERROR:", e)

#ACTIONS = []


KLAYOUT_VERSION = int(pya.Application.instance().version().split('.')[1])
KLAYOUT_VERSION_3 = int(pya.Application.instance().version().split('.')[2])

# Waveguide DevRec: space between the waveguide and the DevRec polygon
WG_DEVREC_SPACE = 1

# Path to Waveguide, path snapping to nearest pin. Search for pin with this distance:
PATH_SNAP_PIN_MAXDIST = 20
MODULE_NUMPY = install_numpy()
except Exception as e:
print("Could not install numpy with pip. ERROR:", e)

#ACTIONS = []


KLAYOUT_VERSION = int(pya.Application.instance().version().split('.')[1])
KLAYOUT_VERSION_3 = int(pya.Application.instance().version().split('.')[2])

# Waveguide DevRec: space between the waveguide and the DevRec polygon
WG_DEVREC_SPACE = 1

# Path to Waveguide, path snapping to nearest pin. Search for pin with this distance:
PATH_SNAP_PIN_MAXDIST = 20

INTC_ELEMENTS = ''
if Python_Env == "KLayout_GUI":
Expand Down

0 comments on commit 30d6242

Please sign in to comment.