Skip to content

Commit

Permalink
opics: improved error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed Mar 3, 2023
1 parent 6a77994 commit 8228d4d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
2 changes: 2 additions & 0 deletions klayout_dot_config/pymacros/SiEPIC - Test Environment.lym
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ if 1:
SiEPIC.utils.layout = reload(SiEPIC.utils.layout)
SiEPIC.utils.geometry = reload(SiEPIC.utils.geometry)
SiEPIC.setup = reload(SiEPIC.setup)
import SiEPIC.opics_netlist_sim
SiEPIC.opics_netlist_sim = reload(SiEPIC.opics_netlist_sim)
#SiEPIC.netlist = reload(SiEPIC.netlist)
import SiEPIC.opics
SiEPIC.opics.utils = reload(SiEPIC.opics.utils)
SiEPIC.opics.network = reload(SiEPIC.opics.network)
SiEPIC.opics.components = reload(SiEPIC.opics.components)
Expand Down
14 changes: 14 additions & 0 deletions klayout_dot_config/python/SiEPIC/opics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
"""Top-level package for OPICS."""

# Required packages:
from SiEPIC.install import install
import pya
if not install('numpy'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'numpy'.", pya.MessageBox.Ok)
if not install('scipy'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'scipy'.", pya.MessageBox.Ok)
if not install('yaml'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'yaml'.", pya.MessageBox.Ok)


from SiEPIC.opics import libraries
from SiEPIC.opics.network import Network
from SiEPIC.opics.utils import netlistParser
Expand Down
33 changes: 28 additions & 5 deletions klayout_dot_config/python/SiEPIC/opics_netlist_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,34 @@ def circuit_simulation_opics(verbose=False,opt_in_selection_text=[], require_sav

# Required packages
from SiEPIC.install import install
install('plotly')
install('pandas')
install('packaging')
install('defusedxml')
install('numpy')
if not install('plotly'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'plotly'.", pya.MessageBox.Ok)
return None
if not install('pandas'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'pandas'.", pya.MessageBox.Ok)
return None
if not install('packaging'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'packaging'.", pya.MessageBox.Ok)
return None
if not install('defusedxml'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'defusedxml'.", pya.MessageBox.Ok)
return None
if not install('numpy'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'numpy'.", pya.MessageBox.Ok)
return None
if not install('yaml'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'yaml'.", pya.MessageBox.Ok)
return None
if not install('scipy'):
pya.MessageBox.warning(
"Missing package", "The OPICS circuit simulator does not function without the package 'scipy'.", pya.MessageBox.Ok)
return None


# obtain the spice file from the layout
Expand Down

0 comments on commit 8228d4d

Please sign in to comment.