-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b8afe3
commit a367ae6
Showing
4 changed files
with
98 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Run SiEPIC-Tool Layout tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- '**' | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
|
||
jobs: | ||
test_layouts: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout repo content | ||
uses: actions/checkout@v3 | ||
|
||
# can also specify python version if needed | ||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
|
||
- name: install python packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install klayout numpy scipy pytest pytest-cov SiEPIC | ||
- name: Test with pytest | ||
run: pytest --cov=klayout/siepic_ebeam_pdk klayout/siepic_ebeam_pdk/pymacros/tests/tests_All_Library_Cells.py --cov-report=xml | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
fail_ci_if_error: true | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# $description: Unit testing: all EBeam libraries' cells | ||
# $show-in-menu | ||
# $group-name: Examples_EBeam | ||
# $menu-path: siepic_menu.exlayout.end | ||
# Unit testing for all library layout fixed cells and PCells | ||
|
||
tech_name = 'EBeam' | ||
|
||
import pya # klayout | ||
import os, sys | ||
import SiEPIC | ||
from SiEPIC._globals import Python_Env | ||
print('KLayout running in mode: %s' % Python_Env) | ||
from SiEPIC.utils.layout import new_layout, floorplan | ||
from SiEPIC.utils import load_klayout_technology | ||
from SiEPIC.scripts import instantiate_all_library_cells, zoom_out, export_layout | ||
|
||
def test_all_library_cells(): | ||
|
||
if Python_Env == 'Script': | ||
# Load the PDK from a folder, e.g, GitHub, when running externally from the KLayout Application | ||
import sys | ||
path = os.path.dirname(os.path.realpath(__file__)) | ||
sys.path.insert(0,os.path.abspath(os.path.join(path, '../../..'))) | ||
import siepic_ebeam_pdk | ||
|
||
|
||
# Create a new layout | ||
topcell, ly = new_layout(tech_name, "UnitTesting", GUI=True, overwrite = True) | ||
|
||
# Instantiate all cells | ||
instantiate_all_library_cells(topcell) | ||
|
||
''' | ||
# Save the layout | ||
path_out = os.path.dirname(os.path.realpath(__file__)) | ||
ly.write(os.path.join(path_out,'a.gds')) | ||
export_layout(topcell, path_out,'a_static',format='oas') | ||
print('done') | ||
''' | ||
|
||
# Check if there are any errors | ||
for cell_id in topcell.called_cells(): | ||
c = ly.cell(cell_id) | ||
error_shapes = c.shapes(ly.error_layer()) | ||
for error in error_shapes.each(): | ||
raise Exception('Error in cell: %s, %s' % (c.name, error.text)) | ||
if c.is_empty() or c.bbox().area() == 0: | ||
raise Exception('Empty cell: %s' % c.name) | ||
|
||
|
||
if __name__ == "__main__": | ||
test_all_library_cells() |
This file was deleted.
Oops, something went wrong.