-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from SiEPIC/version_check
SiEPIC Version check, layout_diff
- Loading branch information
Showing
6 changed files
with
221 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
klayout_dot_config/python/SiEPIC/tests/test_scripts_layout_diff.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
""" | ||
Test for SiEPIC.scripts.layout_diff | ||
by Lukas Chrostowski 2024 | ||
""" | ||
|
||
def test_layout_diff(): | ||
''' | ||
''' | ||
|
||
import pya | ||
|
||
import SiEPIC | ||
from SiEPIC._globals import Python_Env | ||
from SiEPIC.utils.layout import new_layout | ||
|
||
import os | ||
|
||
if Python_Env == 'Script': | ||
# For external Python mode, when installed using pip install siepic_ebeam_pdk | ||
import GSiP | ||
|
||
tech_name = 'GSiP' | ||
|
||
from packaging import version | ||
if version.parse(SiEPIC.__version__) < version.parse("0.5.4"): | ||
raise Exception("Errors", "This example requires SiEPIC-Tools version 0.5.4 or greater.") | ||
|
||
''' | ||
Create a new layout using the EBeam technology, | ||
with a top cell | ||
''' | ||
cell, ly = new_layout(tech_name, 'top', GUI=True, overwrite = True) | ||
|
||
waveguide_type_delay='SiN routing TE 1550 nm (compound waveguide)' | ||
|
||
# Load cells from library | ||
cell1 = ly.create_cell('Ring_Modulator_DB', 'GSiP', | ||
{'r':10, | ||
}) | ||
cell2 = ly.create_cell('Ring_Modulator_DB', 'GSiP', | ||
{'r':11, | ||
}) | ||
|
||
from SiEPIC.scripts import layout_diff | ||
|
||
num_diff = layout_diff(cell1, cell2) | ||
print(num_diff) | ||
assert num_diff == 123 | ||
|
||
cell3 = cell1.dup() | ||
num_diff = layout_diff(cell1, cell3) | ||
print(num_diff) | ||
assert num_diff == 0 | ||
|
||
if __name__ == "__main__": | ||
test_layout_diff() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters