diff --git a/.bumpversion.cfg b/.bumpversion.cfg
new file mode 100644
index 0000000..3b3ce83
--- /dev/null
+++ b/.bumpversion.cfg
@@ -0,0 +1,8 @@
+[bumpversion]
+current_version = 0.0.1
+commit = True
+tag = True
+
+[bumpversion:file:./pyproject.toml]
+[bumpversion:file:./README.md]
+[bumpversion:file:gvtt/__init__.py]
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..0aada4d
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,11 @@
+version: 2
+updates:
+ - package-ecosystem: "pip"
+ directory: "/" # Location of package manifests
+ schedule:
+ interval: "daily"
+
+ - package-ecosystem: github-actions
+ directory: /
+ schedule:
+ interval: monthly
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
new file mode 100644
index 0000000..5553661
--- /dev/null
+++ b/.github/workflows/pages.yml
@@ -0,0 +1,46 @@
+name: Sphinx docs to gh-pages
+
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ build-docs:
+ runs-on: ubuntu-latest
+ name: Sphinx docs to gh-pages
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Installing the library
+ shell: bash -l {0}
+ run: |
+ make dev
+ - name: make docs
+ run: |
+ make docs
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v1
+ with:
+ path: "./docs/_build/html/"
+ deploy-docs:
+ needs: build-docs
+ permissions:
+ pages: write
+ id-token: write
+
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+
+ runs-on: ubuntu-latest
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v2
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..8f5fa5d
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,28 @@
+name: Release PyPI, installers and docker container
+
+on:
+ push:
+ tags: "v*"
+
+jobs:
+ release_pypi:
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.x
+ cache-dependency-path: pyproject.toml
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install setuptools wheel twine
+ - name: Build and publish
+ env:
+ TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
+ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+ run: |
+ make build
+ twine upload dist/*
diff --git a/.github/workflows/test_code.yml b/.github/workflows/test_code.yml
new file mode 100644
index 0000000..81c887e
--- /dev/null
+++ b/.github/workflows/test_code.yml
@@ -0,0 +1,85 @@
+name: Test pre-commit, code and docs
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+
+jobs:
+ pre-commit:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.10"
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Test pre-commit hooks
+ run: |
+ python -m pip install --upgrade pip
+ pip install pre-commit
+ pre-commit run -a
+ test_code:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ max-parallel: 12
+ matrix:
+ python-version: ["3.10"]
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Install dependencies
+ run: |
+ make dev
+ - name: Test with pytest
+ run: pytest
+ test_code_coverage:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ - name: Install dependencies
+ run: |
+ make dev
+ - name: Test with pytest
+ run: |
+ pytest --cov
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v3
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ fail_ci_if_error: false
+ test_docs:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ max-parallel: 12
+ matrix:
+ python-version: ['3.10']
+ os: [ubuntu-latest]
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Install dependencies
+ run: |
+ make dev
+ - name: Test documentation
+ run: |
+ make docs
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3a31447
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,146 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+*.fsp
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+extra/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+*.ipynb
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+**/*.ipynb_checkpoints/
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+*.DS_Store
+.DS_Store
+*Thumbs.db
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..c231cba
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,136 @@
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: "9260cbc9c84c06022993bfbcc42fdbf0305c5b8e"
+ hooks:
+ - id: check-added-large-files
+ - id: check-case-conflict
+ - id: check-merge-conflict
+ - id: check-symlinks
+ - id: check-yaml
+ - id: debug-statements
+ - id: end-of-file-fixer
+ - id: mixed-line-ending
+ - id: name-tests-test
+ args: ["--pytest-test-first"]
+ - id: trailing-whitespace
+
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
+ rev: "6a0ba1854991b693612486cc84a2254de82d071d"
+ hooks:
+ - id: ruff
+
+ - repo: https://github.com/psf/black
+ rev: "d9b8a6407e2f46304a8d36b18e4a73d8e0613519"
+ hooks:
+ - id: black
+
+ - repo: https://github.com/asottile/pyupgrade
+ rev: ddb39ad37166dbc938d853cc77606526a0b1622a
+ hooks:
+ - id: pyupgrade
+ args: [--py37-plus, --keep-runtime-typing]
+
+ - repo: https://github.com/shellcheck-py/shellcheck-py
+ rev: 953faa6870f6663ac0121ab4a800f1ce76bca31f
+ hooks:
+ - id: shellcheck
+
+ - repo: https://github.com/PyCQA/bandit
+ rev: fe1361fdcc274850d4099885a802f2c9f28aca08
+ hooks:
+ - id: bandit
+ args: [--exit-zero]
+ # ignore all tests, not just tests data
+ exclude: ^tests/
+
+ # - repo: https://github.com/pre-commit/mirrors-mypy
+ # rev: "v1.0.1"
+ # hooks:
+ # - id: mypy
+ # exclude: ^(docs/|example-plugin/|tests/fixtures)
+ # additional_dependencies:
+ # - "pydantic"
+
+ # - repo: https://github.com/terrencepreilly/darglint
+ # rev: master
+ # hooks:
+ # - id: darglint
+ # - repo: https://github.com/pycqa/pydocstyle
+ # rev: "a6fe4222012e990042c86cdaaa904a8d059752ee"
+ # hooks:
+ # - id: pydocstyle
+ # additional_dependencies: ["pydocstyle[toml]"]
+ # - repo: https://github.com/asottile/reorder_python_imports
+ # rev: 2b2f0c74acdb3de316e23ceb7dd0d7945c354050
+ # hooks:
+ # - id: reorder-python-imports
+ # - repo: https://github.com/PyCQA/pylint
+ # rev: v2.14.1
+ # hooks:
+ # - id: pylint
+ # args: [--exit-zero]
+ # - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
+ # rev: 6565d773ca281682d7062d4c0be74538cc474cc9
+ # hooks:
+ # - id: pretty-format-java
+ # args: [--autofix]
+ # - id: pretty-format-kotlin
+ # args: [--autofix]
+ # - id: pretty-format-yaml
+ # args: [--autofix, --indent, "2"]
+ # - repo: https://github.com/adrienverge/yamllint.git
+ # rev: v1.21.0 # or higher tag
+ # hooks:
+ # - id: yamllint
+ # args: [--format, parsable, --strict]
+ # - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
+ # rev: 0.1.0 # or specific tag
+ # hooks:
+ # - id: yamlfmt
+ # - repo: https://github.com/pre-commit/pygrep-hooks
+ # rev: "f6fb13e9516d1a9720a30a4049c930235abd642e"
+ # hooks:
+ # - id: python-check-blanket-noqa
+ # - id: python-check-blanket-type-ignore
+ # - id: python-no-log-warn
+ # - id: python-no-eval
+ # - id: python-use-type-annotations
+ # - id: rst-backticks
+ # - id: rst-directive-colons
+ # - id: rst-inline-touching-normal
+ # - repo: https://github.com/nbQA-dev/nbQA
+ # rev: 952c895a21aced4601165c43f77188559a5e825c
+ # hooks:
+ # - id: nbqa-black
+ # additional_dependencies: [jupytext, black] # optional, only if you're using Jupytext
+ # - id: nbqa-pyupgrade
+ # args: ["--py37-plus"]
+ # - id: nbqa-flake8
+ # - id: nbqa-isort
+ # args: ["--float-to-top"]
+ # - repo: https://github.com/hakancelik96/unimport
+ # rev: 0.14.1
+ # hooks:
+ # - id: unimport
+ # args: [--remove, --include-star-import]
+ # - repo: https://github.com/pycqa/isort
+ # rev: "3a72e069635a865a92b8a0273aa829f630cbcd6f"
+ # hooks:
+ # - id: isort
+ # files: "demo_project/.*"
+ # args: ["--profile", "black", "--filter-files"]
+
+ # - repo: https://github.com/kynan/nbstripout
+ # rev: e4c5b4dcbab4afa0b88b7a9243db42b1a8d95dde
+ # hooks:
+ # - id: nbstripout
+ # files: ".ipynb"
+ # - repo: https://github.com/codespell-project/codespell
+ # rev: 68ea3cff5eba266e0814794cce6cd19537f58137
+ # hooks:
+ # - id: codespell
+ # args: ["-L TE,TE/TM,te,ba,FPR,fpr_spacing,ro,donot"]
+ # - repo: https://github.com/pre-commit/pygrep-hooks
+ # rev: 7b4409161486c6956bb3206ce96db5d56731b1b9 # Use the ref you want to point at
+ # hooks:
+ # - id: python-use-type-annotations
diff --git a/LICENSE b/LICENSE
index dacb95d..d6a7b7e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -20,4 +20,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
+SOFTWARE.
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 873f104..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1 +0,0 @@
-include vtt_tech_public/vtt-layer-list.yaml
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e4b8a40
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,56 @@
+
+install:
+ pip install -e .[dev]
+ pre-commit install
+
+dev:
+ pip install -e .[dev,docs]
+
+
+test:
+ pytest -s
+
+cov:
+ pytest --cov=gvtt
+
+mypy:
+ mypy . --ignore-missing-imports
+
+pylint:
+ pylint gvtt
+
+ruff:
+ ruff --fix gvtt/*.py
+
+git-rm-merged:
+ git branch -D `git branch --merged | grep -v \* | xargs`
+
+update:
+ pur
+
+update-pre:
+ pre-commit autoupdate --bleeding-edge
+
+git-rm-merged:
+ git branch -D `git branch --merged | grep -v \* | xargs`
+
+release:
+ git push
+ git push origin --tags
+
+build:
+ rm -rf dist
+ pip install build
+ python -m build
+
+jupytext:
+ jupytext docs/**/*.ipynb --to py
+
+notebooks:
+ jupytext docs/**/*.py --to ipynb
+
+
+docs:
+ jb build docs
+
+.PHONY: drc doc docs
diff --git a/README.md b/README.md
index 6471b36..ec4311a 100644
--- a/README.md
+++ b/README.md
@@ -1,26 +1,32 @@
# gdsfactory-vtt-public-pdk
-A public [gdsfactory](https://gdsfactory.github.io/gdsfactory/index.html#) process design kit (PDK) for VTT's 3 um SOI
-platform.
+A public [gdsfactory](https://gdsfactory.github.io/gdsfactory/index.html#) process design kit (PDK) for VTT's 3 um SOI platform.
© VTT 2023
-## Installation
+### Installation for users
-Easiest way to install is by using the [Anaconda](https://www.anaconda.com/download) Python distribution. Download
-the `environment.yml` file in the inder folder and then run in an Anaconda prompt:
+Use python3.10 or python3.11, as some tools like kfactory are not available for older versions of python. We recommend [VSCode](https://code.visualstudio.com/) as an IDE.
- conda env create --file environment.yml
+If you don't have python installed on your system you can [download anaconda](https://www.anaconda.com/download/)
-This will create a new Python environment labeled `gf` with all the required packages installed.
-You will need to point your editor Python interpreter to this environment, how to do this depends on the editor.
+Once you have python installed, open Anaconda Prompt as Administrator and then install the latest gdsfactory using pip.
-In addition you should install [Klayout](http://www.klayout.de) and the Klive package from the integrated pacakge
-manager.
+
+```
+pip install gvtt --upgrade
+```
-## Testing the PDK without installation
+Then you need to restart Klayout to make sure the new technology installed appears.
-If you want to test the PDK you can run it in browser by clicking the link below.
-This will open up a new page with a preconfigured Jupyter notebook running on [mybinder.org](https://mybinder.org).
+### Installation for developers
-[](https://mybinder.org/v2/git/https%3A%2F%2Fgitlab.vtt.fi%2Fttemth%2Fgdsfactory-vtt-public-pdk/HEAD)
+For developers you need to `git clone` the GitHub repository, fork it, git add, git commit, git push and merge request your changes.
+
+```
+git clone https://github.com/gdsfactory/vtt.git
+cd vtt
+pip install -e . pre-commit
+pre-commit install
+python install_tech.py
+```
diff --git a/binder/environment.yml b/binder/environment.yml
deleted file mode 100644
index 3de5d99..0000000
--- a/binder/environment.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: gf
-
-dependencies:
- - python=3.11
- - pyyaml
- - pip
- - pip:
- - gdsfactory==6.102.4
- - black[d]
- - https://gitlab.vtt.fi/ttemth/gdsfactory-vtt-public-pdk/-/archive/main/gdsfactory-vtt-public-pdk-main.zip
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100755
index 0000000..f050586
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1,58 @@
+# Book settings
+# Learn more at https://jupyterbook.org/customize/config.html
+
+title: gvtt
+author: gdsfactory
+
+# Force re-execution of notebooks on each build.
+# See https://jupyterbook.org/content/execute.html
+execute:
+ execute_notebooks: cache
+ timeout: -1
+ allow_errors: true
+ # execute_notebooks: force
+ # execute_notebooks: "off"
+ # exclude_patterns:
+ # - '*notebooks/devsim/01_pin_waveguide*'
+
+latex:
+ latex_engine: pdflatex # one of 'pdflatex', 'xelatex' (recommended for unicode), 'luatex', 'platex', 'uplatex'
+ use_jupyterbook_latex: true # use sphinx-jupyterbook-latex for pdf builds as default
+
+# Add a bibtex file so that we can create citations
+
+html:
+ home_page_in_navbar: true
+ use_edit_page_button: true
+ use_repository_button: true
+ use_issues_button: true
+ baseurl: https://github.com/gdsfactory/vtt
+
+# Information about where the book exists on the web
+repository:
+ url: https://github.com/gdsfactory/vtt
+ path_to_book: docs # Optional path to your book, relative to the repository root
+ branch: main # Which branch of the repository should be used when creating links (optional)
+
+launch_buttons:
+ notebook_interface: jupyterlab
+ colab_url: "https://colab.research.google.com"
+
+sphinx:
+ extra_extensions:
+ - "sphinx.ext.autodoc"
+ - "sphinx.ext.autodoc.typehints"
+ - "sphinx.ext.autosummary"
+ - "sphinx.ext.napoleon"
+ - "sphinx.ext.viewcode"
+ - "matplotlib.sphinxext.plot_directive"
+ - "sphinxcontrib.autodoc_pydantic"
+ config:
+ #autodoc_typehints: description
+ autodoc_type_aliases:
+ "ComponentSpec": "ComponentSpec"
+ nb_execution_show_tb: True
+ nb_custom_formats:
+ .py:
+ - jupytext.reads
+ - fmt: py
diff --git a/docs/_toc.yml b/docs/_toc.yml
new file mode 100644
index 0000000..6d86a25
--- /dev/null
+++ b/docs/_toc.yml
@@ -0,0 +1,7 @@
+# Table of contents
+# Learn more at https://jupyterbook.org/customize/toc.html
+
+format: jb-book
+root: index
+chapters:
+ - file: changelog
diff --git a/docs/changelog.md b/docs/changelog.md
new file mode 100644
index 0000000..ba6026f
--- /dev/null
+++ b/docs/changelog.md
@@ -0,0 +1 @@
+# [CHANGELOG](https://keepachangelog.com/en/1.0.0/)
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..451beda
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,2 @@
+```{include} ../README.md
+```
diff --git a/examples/python/tutorial-1.py b/examples/python/tutorial-1.py
index 7214577..a20fd51 100644
--- a/examples/python/tutorial-1.py
+++ b/examples/python/tutorial-1.py
@@ -1,8 +1,10 @@
import gdsfactory as gf
-c = gf.Component("training") # Component can be though to be a canvas to draw on. It maps to GDS cells.
+c = gf.Component(
+ "training"
+) # Component can be though to be a canvas to draw on. It maps to GDS cells.
-# define components using standard gdsfactory functions
+# define components using standard gdsfactory functions
str = gf.components.straight(length=10)
bend = gf.get_component("bend_euler", angle=90, decorator=gf.add_pins.add_pins_triangle)
diff --git a/examples/python/tutorial-2.py b/examples/python/tutorial-2.py
index 1b2d0c6..e626bdc 100644
--- a/examples/python/tutorial-2.py
+++ b/examples/python/tutorial-2.py
@@ -6,6 +6,7 @@
# To make reusable elements, you can encapsulate the designs as cells.
# The cells can be parametrized for further flexibility.
+
@gf.cell
def arm(angle: float = 90.0) -> gf.Component:
c = gf.Component(name="arm")
@@ -31,8 +32,8 @@ def arm(angle: float = 90.0) -> gf.Component:
s2.connect("o1", b4.ports["o2"])
- c.add_port("o1", port=s1.ports['o1'])
- c.add_port("o2", port=s2.ports['o2'])
+ c.add_port("o1", port=s1.ports["o1"])
+ c.add_port("o2", port=s2.ports["o2"])
return c
diff --git a/examples/python/tutorial-3.py b/examples/python/tutorial-3.py
index 46e3dbc..370a2d4 100644
--- a/examples/python/tutorial-3.py
+++ b/examples/python/tutorial-3.py
@@ -28,8 +28,8 @@ def arm(angle: float = 90.0) -> gf.Component:
s2.connect("o1", b4.ports["o2"])
- c.add_port("o1", port=s1.ports['o1'])
- c.add_port("o2", port=s2.ports['o2'])
+ c.add_port("o1", port=s1.ports["o1"])
+ c.add_port("o2", port=s2.ports["o2"])
return c
@@ -43,9 +43,9 @@ def arm(angle: float = 90.0) -> gf.Component:
mmi1 = c << mmi
mmi2 = c << mmi
-a1.connect('o1', mmi1.ports['o2'])
-a2.connect('o1', mmi1.ports['o3'])
+a1.connect("o1", mmi1.ports["o2"])
+a2.connect("o1", mmi1.ports["o3"])
-mmi2.connect('o3', a1.ports['o2'])
+mmi2.connect("o3", a1.ports["o2"])
c.show()
diff --git a/examples/python/tutorial-4.py b/examples/python/tutorial-4.py
index e555f31..70577b6 100644
--- a/examples/python/tutorial-4.py
+++ b/examples/python/tutorial-4.py
@@ -30,8 +30,8 @@ def arm(angle: float = 90.0) -> gf.Component:
s2.connect("o1", b4.ports["o2"])
- c.add_port("o1", port=s1.ports['o1'])
- c.add_port("o2", port=s2.ports['o2'])
+ c.add_port("o1", port=s1.ports["o1"])
+ c.add_port("o2", port=s2.ports["o2"])
return c
@@ -48,13 +48,13 @@ def mzi():
mmi1 = c << mmi
mmi2 = c << mmi
- a1.connect('o1', mmi1.ports['o2'])
- a2.connect('o1', mmi1.ports['o3'])
+ a1.connect("o1", mmi1.ports["o2"])
+ a2.connect("o1", mmi1.ports["o3"])
- mmi2.connect('o3', a1.ports['o2'])
+ mmi2.connect("o3", a1.ports["o2"])
- c.add_port("o1", port=mmi1.ports['o1'])
- c.add_port("o2", port=mmi2.ports['o1'])
+ c.add_port("o1", port=mmi1.ports["o1"])
+ c.add_port("o2", port=mmi2.ports["o1"])
return c
diff --git a/examples/python/tutorial-5.py b/examples/python/tutorial-5.py
index a031531..beaaf7d 100644
--- a/examples/python/tutorial-5.py
+++ b/examples/python/tutorial-5.py
@@ -1,8 +1,5 @@
import gdsfactory as gf
-import vtt_tech_public
-
-from gdsfactory.routing.all_angle import auto_taper_connector
c = gf.Component(name="training-5")
@@ -32,8 +29,8 @@ def arm():
s2.connect("o1", b4.ports["o2"])
- c.add_port("o1", port=s1.ports['o1'])
- c.add_port("o2", port=s2.ports['o2'])
+ c.add_port("o1", port=s1.ports["o1"])
+ c.add_port("o2", port=s2.ports["o2"])
return c
@@ -50,13 +47,13 @@ def mzi():
mmi1 = c << mmi
mmi2 = c << mmi
- a1.connect('o1', mmi1.ports['o2'])
- a2.connect('o1', mmi1.ports['o3'])
+ a1.connect("o1", mmi1.ports["o2"])
+ a2.connect("o1", mmi1.ports["o3"])
- mmi2.connect('o3', a1.ports['o2'])
+ mmi2.connect("o3", a1.ports["o2"])
- c.add_port("o1", port=mmi1.ports['o1'])
- c.add_port("o2", port=mmi2.ports['o1'])
+ c.add_port("o1", port=mmi1.ports["o1"])
+ c.add_port("o2", port=mmi2.ports["o1"])
return c
@@ -67,9 +64,11 @@ def mzi():
die = c << gf.get_component("die")
p1 = c << gf.get_component("edge_coupler_rib", pos=-250, die=die)
-p2 = c << gf.get_component("edge_coupler_rib", pos=1000, die=die, side='E')
+p2 = c << gf.get_component("edge_coupler_rib", pos=1000, die=die, side="E")
-routes = gf.routing.get_bundle_all_angle([mymzi.ports['o1'], mymzi.ports['o2']], [p1.ports['o1'], p2.ports['o1']])
+routes = gf.routing.get_bundle_all_angle(
+ [mymzi.ports["o1"], mymzi.ports["o2"]], [p1.ports["o1"], p2.ports["o1"]]
+)
for route in routes:
c.add(route.references)
diff --git a/vtt_tech_public/__init__.py b/gvtt/__init__.py
similarity index 81%
rename from vtt_tech_public/__init__.py
rename to gvtt/__init__.py
index 402f0de..843d4c7 100644
--- a/vtt_tech_public/__init__.py
+++ b/gvtt/__init__.py
@@ -1,19 +1,13 @@
from __future__ import annotations
-import pathlib
-
-from .layers import LAYER
-from .xsections import cross_sections
-
-from gdsfactory.technology import LayerViews
-from .config import PATH
-
from gdsfactory.pdk import Pdk, constants
-
from gdsfactory.get_factories import get_cells
import gdsfactory
-from . import components
+from gvtt.layers import LAYER
+from gvtt.xsections import cross_sections
+from gvtt.config import PATH
+from gvtt import components
cells = get_cells([components])
@@ -68,13 +62,13 @@
gdsfactory.routing.all_angle.LOW_LOSS_CROSS_SECTIONS = [
{"cross_section": "rib", "settings": {"width": 2.5}},
{"cross_section": "strip", "settings": {"width": 6.0}},
- {"cross_section": "strip", "settings": {"width": 3.0}}
+ {"cross_section": "strip", "settings": {"width": 3.0}},
]
pdk.activate()
if __name__ == "__main__":
- layer_views = LayerViews(filepath=PATH.klayout_yaml)
- layer_views.to_lyp(PATH.klayout_lyp)
+ # layer_views = LayerViews(filepath=PATH.lyp_yaml)
+ # layer_views.to_lyp(PATH.lyp)
- # print(pdk.name)
+ print(pdk.name)
diff --git a/gvtt/components/__init__.py b/gvtt/components/__init__.py
new file mode 100644
index 0000000..55eeec2
--- /dev/null
+++ b/gvtt/components/__init__.py
@@ -0,0 +1,35 @@
+from gvtt.components.bend_euler import (
+ bend_euler,
+)
+from gvtt.components.die import (
+ box,
+ die,
+)
+from gvtt.components.edge_coupler_rib import (
+ edge_coupler_rib,
+)
+from gvtt.components.mmi1x2 import (
+ mmi1x2,
+)
+from gvtt.components.mmi2x2 import (
+ mmi2x2,
+)
+from gvtt.components.transitions import (
+ rib_taper,
+ rib_to_strip,
+ strip_taper,
+ xs_rib_strip,
+)
+
+__all__ = [
+ "bend_euler",
+ "box",
+ "die",
+ "edge_coupler_rib",
+ "mmi1x2",
+ "mmi2x2",
+ "rib_taper",
+ "rib_to_strip",
+ "strip_taper",
+ "xs_rib_strip",
+]
diff --git a/vtt_tech_public/components/bend_euler.py b/gvtt/components/bend_euler.py
similarity index 95%
rename from vtt_tech_public/components/bend_euler.py
rename to gvtt/components/bend_euler.py
index e9a0d1f..ad9e52a 100644
--- a/vtt_tech_public/components/bend_euler.py
+++ b/gvtt/components/bend_euler.py
@@ -4,14 +4,12 @@
import gdsfactory as gf
from gdsfactory.add_padding import get_padding_points
from gdsfactory.component import Component
-from gdsfactory.components.straight import straight
from gdsfactory.components.wire import wire_corner
-from gdsfactory.cross_section import strip
from gdsfactory.path import euler
from gdsfactory.typings import CrossSectionSpec, Optional
-def eulerR_1550(angle):
+def _eulerR_1550(angle: float) -> float:
if angle == 0:
return 0.0
p, v, a0 = 0.79, 2093.0, 18.75 # for 1550 nm, TE, 1.875 um
@@ -62,9 +60,8 @@ def bend_euler(
o1_____/
"""
-
x = gf.get_cross_section(cross_section, **kwargs)
- radius = eulerR_1550(abs(angle))
+ radius = _eulerR_1550(abs(angle))
if radius is None:
return wire_corner(cross_section=x)
@@ -110,3 +107,8 @@ def bend_euler(
c.absorb(ref)
return c
+
+
+if __name__ == "__main__":
+ c = bend_euler()
+ c.show(show_ports=True)
diff --git a/vtt_tech_public/components/die.py b/gvtt/components/die.py
similarity index 74%
rename from vtt_tech_public/components/die.py
rename to gvtt/components/die.py
index ff1e8c6..2da1216 100644
--- a/vtt_tech_public/components/die.py
+++ b/gvtt/components/die.py
@@ -1,26 +1,22 @@
from typing import Optional, Tuple, Union
-import numpy as np
-
import gdsfactory as gf
from gdsfactory.components.text import text
from gdsfactory.typings import LayerSpec, ComponentSpec, Float2
-import vtt_tech_public
+import gvtt
def box(x0, y0, w, h):
dw = w / 2.0
dh = h / 2.0
- retval = [
+ return [
[x0 + dw, y0 + dh],
[x0 + dw, y0 - dh],
[x0 - dw, y0 - dh],
[x0 - dw, y0 + dh],
]
- return retval
-
@gf.cell
def die(
@@ -39,7 +35,7 @@ def die(
c = gf.Component(name="die")
w, h = size[0], size[1]
- for layer, size in vtt_tech_public.frame_dimensions.items():
+ for layer, size in gvtt.frame_dimensions.items():
c.add_polygon(box(w / 2.0 - size / 2.0, 0.0, size, h), layer=layer)
c.add_polygon(box(-w / 2.0 + size / 2.0, 0.0, size, h), layer=layer)
@@ -53,17 +49,22 @@ def die(
)
c.info["port_x_position_west"] = (
- -w / 2.0 + vtt_tech_public.frame_dimensions[vtt_tech_public.LAYER.WG_SNGL_ADD] + 1.5
+ -w / 2.0 + gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] + 1.5
)
c.info["port_x_position_east"] = (
- w / 2.0 - vtt_tech_public.frame_dimensions[vtt_tech_public.LAYER.WG_SNGL_ADD] - 1.5
+ w / 2.0 - gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] - 1.5
)
c.info["port_y_position_north"] = (
- h / 2.0 - vtt_tech_public.frame_dimensions[vtt_tech_public.LAYER.WG_SNGL_ADD] - 1.5
+ h / 2.0 - gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] - 1.5
)
c.info["port_y_position_south"] = (
- -h / 2.0 + vtt_tech_public.frame_dimensions[vtt_tech_public.LAYER.WG_SNGL_ADD] + 1.5
+ -h / 2.0 + gvtt.frame_dimensions[gvtt.LAYER.WG_SNGL_ADD] + 1.5
)
return c
+
+
+if __name__ == "__main__":
+ c = die()
+ c.show()
diff --git a/gvtt/components/edge_coupler_rib.py b/gvtt/components/edge_coupler_rib.py
new file mode 100644
index 0000000..141ada0
--- /dev/null
+++ b/gvtt/components/edge_coupler_rib.py
@@ -0,0 +1,39 @@
+import gdsfactory as gf
+from gdsfactory.component import Component
+from gvtt.xsections import rib
+
+
+@gf.cell
+def edge_coupler_rib(
+ edge_coupling_width: float = 3.0,
+ polishing_length: float = 25.0,
+ side: str = "W",
+ xpos: float = 0.0,
+ ypos: float = 0.0,
+) -> Component:
+ c = gf.Component()
+ side = side.upper()
+
+ if side == "W":
+ orientation = 0
+ if side == "E":
+ orientation = 180
+ if side == "N":
+ orientation = -90
+ if side == "S":
+ orientation = 90
+
+ ref = c << gf.components.straight(
+ cross_section=rib(edge_coupling_width), length=polishing_length
+ )
+ ref.rotate(orientation)
+ ref.move((xpos, ypos))
+
+ c.add_port("o1", port=ref.ports["o2"])
+ c.absorb(ref)
+ return c
+
+
+if __name__ == "__main__":
+ c = edge_coupler_rib()
+ c.show()
diff --git a/gvtt/components/mmi1x2.py b/gvtt/components/mmi1x2.py
new file mode 100644
index 0000000..5787cce
--- /dev/null
+++ b/gvtt/components/mmi1x2.py
@@ -0,0 +1,16 @@
+from gdsfactory.components import mmi1x2 as _mmi1x2
+from functools import partial
+from gvtt.xsections import strip
+from gvtt.components.transitions import strip_taper
+
+
+mmi1x2 = partial(
+ _mmi1x2,
+ width_mmi=6.25,
+ length_mmi=43.25,
+ width_taper=1.875,
+ cross_section=strip,
+ gap_mmi=(6.25 - 2 * 1.875) / 2,
+ taper=strip_taper,
+ length_taper=1.0,
+)
diff --git a/gvtt/components/mmi2x2.py b/gvtt/components/mmi2x2.py
new file mode 100644
index 0000000..df4ec3f
--- /dev/null
+++ b/gvtt/components/mmi2x2.py
@@ -0,0 +1,16 @@
+from gdsfactory.components import mmi2x2 as _mmi2x2
+from functools import partial
+from gvtt.xsections import strip
+from gvtt.components.transitions import strip_taper
+
+
+mmi2x2 = partial(
+ _mmi2x2,
+ width_mmi=5.0,
+ length_mmi=112.0,
+ width_taper=1.875,
+ cross_section=strip,
+ gap_mmi=1.25,
+ taper=strip_taper,
+ length_taper=1.0,
+)
diff --git a/vtt_tech_public/components/rib_strip_converter.py b/gvtt/components/transitions.py
similarity index 78%
rename from vtt_tech_public/components/rib_strip_converter.py
rename to gvtt/components/transitions.py
index f5f24d5..7ede6d8 100644
--- a/vtt_tech_public/components/rib_strip_converter.py
+++ b/gvtt/components/transitions.py
@@ -1,10 +1,12 @@
+from typing import Optional
+
import gdsfactory as gf
from gdsfactory.component import Component
from gdsfactory.components.taper_cross_section import taper_cross_section
-import vtt_tech_public
-from typing import Optional
from gdsfactory.cross_section import Section, CrossSection, LayerSpec
+from gvtt.xsections import rib, strip
+
@gf.xsection
def xs_rib_strip(
@@ -54,7 +56,6 @@ def rib_to_strip(
length=200.0,
width1=3.0,
width2=3.0,
- **kwargs,
) -> Component:
"""
Standard rib-to-strip waveguide converter.
@@ -98,50 +99,33 @@ def rib_to_strip(
return c
-@gf.cell
-def strip_to_rib(
- length=200.0,
- width1=3.0,
- width2=3.0,
- **kwargs,
-) -> Component:
- """
- Standard rib-to-strip waveguide converter.
- """
-
- c = rib_to_strip(width1=width2, width2=width1)
- c.ports["o1"].name = "o2"
- c.ports["o2"].name = "o1"
- return c
-
-
@gf.cell
def strip_taper(
width1=1,
width2=1,
taper_ratio=25.0,
+ length: Optional[float] = None,
**kwargs,
) -> Component:
"""
Standard rib-to-strip waveguide converter.
"""
- if "length" not in kwargs.keys():
- kwargs["length"] = abs(width1 - width2) * taper_ratio
-
- if "cross_section" in kwargs.keys():
- del kwargs["cross_section"]
+ length = length or abs(width1 - width2) * taper_ratio or 10e-3
+ kwargs.pop("cross_section", None)
+ c = gf.Component()
- c = taper_cross_section(
- cross_section1=vtt_tech_public.xsections.strip(width1),
- cross_section2=vtt_tech_public.xsections.strip(width2),
+ ref = c << taper_cross_section(
+ cross_section1=strip(width1),
+ cross_section2=strip(width2),
linear=True,
npoints=2,
**kwargs,
)
- c.info["length"] = kwargs["length"]
+ c.info["length"] = length
c.info["width1"] = float(width1)
c.info["width2"] = float(width2)
-
+ c.add_ports(ref.ports)
+ c.absorb(ref)
return c
@@ -150,15 +134,17 @@ def rib_taper(
width1=1,
width2=1,
taper_ratio=50.0,
+ length: Optional[float] = None,
**kwargs,
) -> Component:
"""
Standard rib-to-strip waveguide converter.
"""
- length = abs(width1 - width2) * taper_ratio
- c = taper_cross_section(
- cross_section1=vtt_tech_public.xsections.rib(width1),
- cross_section2=vtt_tech_public.xsections.rib(width2),
+ length = length or abs(width1 - width2) * taper_ratio or 10e-3
+ c = gf.Component()
+ ref = c << taper_cross_section(
+ cross_section1=rib(width1),
+ cross_section2=rib(width2),
length=length,
linear=True,
npoints=2,
@@ -167,4 +153,13 @@ def rib_taper(
c.info["length"] = length
c.info["width1"] = float(width1)
c.info["width2"] = float(width2)
+ c.add_ports(ref.ports)
+ c.absorb(ref)
return c
+
+
+if __name__ == "__main__":
+ c = rib_taper()
+ # c = strip_taper()
+ # c.pprint_ports()
+ c.show()
diff --git a/vtt_tech_public/config.py b/gvtt/config.py
similarity index 82%
rename from vtt_tech_public/config.py
rename to gvtt/config.py
index 06e6d6a..516bc29 100644
--- a/vtt_tech_public/config.py
+++ b/gvtt/config.py
@@ -1,4 +1,3 @@
-
__all__ = ["PATH"]
import pathlib
@@ -16,11 +15,12 @@
class Path:
- layer_lib = module_path / "VTT-layer-list.yaml"
+ layer_lib = module_path / "vtt-layer-list.yaml"
module = module_path
repo = repo_path
+ tech_dir = module_path / "klayout"
lyp = module_path / "klayout" / "layers.lyp"
- lyp_yaml = module_path / "klayout" / "layers.yaml"
+ lyp_yaml = module_path / "layers.yaml"
libs = module_path / "vtt3um"
sparameters = module_path / "sparameters"
@@ -34,4 +34,4 @@ class Path:
PATH = Path()
if __name__ == "__main__":
- print(PATH)
\ No newline at end of file
+ print(PATH)
diff --git a/klayout/layer_boolean.lym b/gvtt/klayout/layer_boolean.lym
similarity index 98%
rename from klayout/layer_boolean.lym
rename to gvtt/klayout/layer_boolean.lym
index b5d5466..d7147c8 100644
--- a/klayout/layer_boolean.lym
+++ b/gvtt/klayout/layer_boolean.lym
@@ -34,11 +34,11 @@ for i in range(layout.layers()):
lr, dt = layout.get_info(i).layer, layout.get_info(i).datatype
op = dt // 10
tgt = dt % 10
-
+
# if not (lr >= 0 and lr <= 10 and op > 0 and op < 4):
# continue
-
+
if layout.is_valid_layer(i):
if op == 1:
add_dict[(lr, tgt)] = i
@@ -46,7 +46,7 @@ for i in range(layout.layers()):
sub_dict[(lr, tgt)] = i
elif op == 3:
cpy_dict[(lr, tgt)] = i
-
+
layers_to_iterate = list(add_dict.keys())
layers_to_iterate.extend(list(cpy_dict.keys()))
@@ -60,27 +60,27 @@ info_cpy = None
for cell in layout.top_cells():
for key in list(set(layers_to_iterate)):
layout.clear_layer(layout.layer(*key))
-
+
info_add = None
info_sub = None
info_cpy = None
-
+
if key in add_dict.keys():
res = pya.Region(cell.begin_shapes_rec(add_dict[key]))
info_add = layout.get_info(add_dict[key])
else:
res = pya.Region()
-
+
if key in sub_dict.keys():
res = res - pya.Region(cell.begin_shapes_rec(sub_dict[key]))
info_sub = layout.get_info(sub_dict[key])
-
+
if key in cpy_dict.keys():
res = res + pya.Region(cell.begin_shapes_rec(cpy_dict[key]))
info_cpy = layout.get_info(cpy_dict[key])
-
+
res.merge()
-
+
cell.shapes(layout.layer(*key)).insert(res)
if delete_source:
diff --git a/gvtt/klayout/layers.lyp b/gvtt/klayout/layers.lyp
new file mode 100644
index 0000000..21d7ff7
--- /dev/null
+++ b/gvtt/klayout/layers.lyp
@@ -0,0 +1,1142 @@
+
+
+
+ #262262
+ #262262
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_RIBS_ADD
+ 1/10@1
+
+
+ #00aeef
+ #00aeef
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_MOST_ADD
+ 1/11@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_LANE_ADD
+ 1/12@1
+
+
+ #ef4036
+ #ef4036
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_DEOX_ADD
+ 1/13@1
+
+
+ #92278f
+ #92278f
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_ARCO_ADD
+ 1/14@1
+
+
+ #00a651
+ #00a651
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_SNGL_ADD
+ 1/15@1
+
+
+ #8b5e3b
+ #8b5e3b
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_PEDE_ADD
+ 1/16@1
+
+
+ #191741
+ #191741
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_RIBS_SUB
+ 1/20@1
+
+
+ #008bbe
+ #008bbe
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_MOST_SUB
+ 1/21@1
+
+
+ #7e6b0d
+ #7e6b0d
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_LANE_SUB
+ 1/22@1
+
+
+ #e61e12
+ #e61e12
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_DEOX_SUB
+ 1/23@1
+
+
+ #6c1d69
+ #6c1d69
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_ARCO_SUB
+ 1/24@1
+
+
+ #00773a
+ #00773a
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_SNGL_SUB
+ 1/25@1
+
+
+ #69472c
+ #69472c
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_PEDE_SUB
+ 1/26@1
+
+
+ #9792d9
+ #9792d9
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_RIBS_CPY
+ 1/30@1
+
+
+ #a7e7ff
+ #a7e7ff
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_MOST_CPY
+ 1/31@1
+
+
+ #f5e598
+ #f5e598
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_LANE_CPY
+ 1/32@1
+
+
+ #fac5c2
+ #fac5c2
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_DEOX_CPY
+ 1/33@1
+
+
+ #e7a5e5
+ #e7a5e5
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_ARCO_CPY
+ 1/34@1
+
+
+ #82ffbf
+ #82ffbf
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_SNGL_CPY
+ 1/35@1
+
+
+ #dfc7b4
+ #dfc7b4
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_PEDE_CPY
+ 1/36@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_GOLD_ADD
+ 2/12@1
+
+
+ #ef4036
+ #ef4036
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_ALUM_ADD
+ 2/13@1
+
+
+ #92278f
+ #92278f
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_HVIA_ADD
+ 2/14@1
+
+
+ #00a651
+ #00a651
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIRE_ADD
+ 2/15@1
+
+
+ #8b5e3b
+ #8b5e3b
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIPO_ADD
+ 2/16@1
+
+
+ #7e6b0d
+ #7e6b0d
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_GOLD_SUB
+ 2/22@1
+
+
+ #e61e12
+ #e61e12
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_ALUM_SUB
+ 2/23@1
+
+
+ #6c1d69
+ #6c1d69
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_HVIA_SUB
+ 2/24@1
+
+
+ #00773a
+ #00773a
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIRE_SUB
+ 2/25@1
+
+
+ #69472c
+ #69472c
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIPO_SUB
+ 2/26@1
+
+
+ #f5e598
+ #f5e598
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_GOLD_CPY
+ 2/32@1
+
+
+ #fac5c2
+ #fac5c2
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_ALUM_CPY
+ 2/33@1
+
+
+ #e7a5e5
+ #e7a5e5
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_HVIA_CPY
+ 2/34@1
+
+
+ #82ffbf
+ #82ffbf
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIRE_CPY
+ 2/35@1
+
+
+ #dfc7b4
+ #dfc7b4
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIPO_CPY
+ 2/36@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_PIMP_ADD
+ 5/12@1
+
+
+ #ef4036
+ #ef4036
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_NIMP_ADD
+ 5/13@1
+
+
+ #7e6b0d
+ #7e6b0d
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_PIMP_SUB
+ 5/22@1
+
+
+ #e61e12
+ #e61e12
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_NIMP_SUB
+ 5/23@1
+
+
+ #f5e598
+ #f5e598
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_PIMP_CPY
+ 5/32@1
+
+
+ #fac5c2
+ #fac5c2
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_NIMP_CPY
+ 5/33@1
+
+
+ #262262
+ #262262
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_NOXX
+ 63/0@1
+
+
+ #00aeef
+ #00aeef
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_NOME
+ 63/1@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_NOWG
+ 63/2@1
+
+
+ #f1592a
+ #f1592a
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_NOUS
+ 63/9@1
+
+
+ #262262
+ #262262
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_BBOX
+ 63/10@1
+
+
+ #00aeef
+ #00aeef
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_BVIZ
+ 63/11@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_BPIN
+ 63/12@1
+
+
+ #262262
+ #262262
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_LINE
+ 63/40@1
+
+
+ #00aeef
+ #00aeef
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_TRIP
+ 63/41@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_WARN
+ 63/42@1
+
+
+ #ef4036
+ #ef4036
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ AX_INFO
+ 63/63@1
+
+
+ #262262
+ #262262
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_RIBS_DF
+ 1/0@1
+
+
+ #00aeef
+ #00aeef
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_MOST_DF
+ 1/1@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_LANE_DF
+ 1/2@1
+
+
+ #ef4036
+ #ef4036
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_DEOX_DF
+ 1/3@1
+
+
+ #92278f
+ #92278f
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_ARCO_LF
+ 1/4@1
+
+
+ #00a651
+ #00a651
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_SNGL_DF
+ 1/5@1
+
+
+ #8b5e3b
+ #8b5e3b
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ WG_PEDE_LF
+ 1/6@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_GOLD_LF_C
+ 2/2@1
+
+
+ #ef4036
+ #ef4036
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_ALUM_LF
+ 2/3@1
+
+
+ #92278f
+ #92278f
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_HVIA_DF
+ 2/4@1
+
+
+ #00a651
+ #00a651
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIRE_LF
+ 2/5@1
+
+
+ #8b5e3b
+ #8b5e3b
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ ME_WIPO_DF_C
+ 2/6@1
+
+
+ #aa9011
+ #aa9011
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_PIMP_DF
+ 5/2@1
+
+
+ #ef4036
+ #ef4036
+ 0
+ 0
+
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ NP_NIMP_DF
+ 5/3@1
+
+
diff --git a/gvtt/klayout/tech.lyt b/gvtt/klayout/tech.lyt
new file mode 100644
index 0000000..fec8d41
--- /dev/null
+++ b/gvtt/klayout/tech.lyt
@@ -0,0 +1,157 @@
+
+
+ VTT
+
+
+ 0.001
+
+
+ layers.lyp
+ true
+
+
+ 1
+ true
+ true
+
+
+ true
+ layer_map()
+ true
+ true
+
+
+ true
+ layer_map()
+ 0.001
+ true
+ #1
+ true
+ #1
+ false
+ #1
+ true
+ OUTLINE
+ true
+ PLACEMENT_BLK
+ true
+ REGIONS
+ true
+
+ 0
+ true
+ .PIN
+ 2
+ true
+ .PIN
+ 2
+ true
+ .FILL
+ 5
+ true
+ .OBS
+ 3
+ true
+ .BLK
+ 4
+ true
+ .LABEL
+ 1
+ true
+ .LABEL
+ 1
+ true
+
+ 0
+ true
+
+ 0
+ VIA_
+ true
+ default
+ false
+ false
+
+
+
+ false
+ true
+ true
+ 64
+ 0
+ 1
+ 0
+ DATA
+ 0
+ 0
+ BORDER
+ layer_map()
+ true
+
+
+ 0.001
+ 1
+ 100
+ 100
+ 0
+ 0
+ 0
+ false
+ false
+ false
+ true
+ layer_map()
+
+
+ 0
+ 0.001
+ layer_map()
+ true
+ false
+
+
+ 1
+ 0.001
+ layer_map()
+ true
+ false
+ true
+
+
+
+
+ GDS2
+
+ true
+ false
+ false
+ false
+ false
+ false
+ 8000
+ 32000
+ LIB
+
+
+ 2
+ true
+ true
+ 1
+ *
+ false
+
+
+ 0
+
+
+ false
+ false
+
+
+ 0
+
+ true
+
+
+
+
diff --git a/gvtt/layers.py b/gvtt/layers.py
new file mode 100644
index 0000000..8aa4c36
--- /dev/null
+++ b/gvtt/layers.py
@@ -0,0 +1,117 @@
+from gdsfactory.typings import Layer
+from pydantic import BaseModel
+
+
+class LayerMap(BaseModel):
+ # waveguide types
+ TYPE_RIB: Layer = (89, 0)
+ TYPE_STRIP: Layer = (89, 1)
+
+ AX_BBOX: Layer = (63, 10)
+ AX_BPIN: Layer = (63, 12)
+ AX_BVIZ: Layer = (63, 11)
+ AX_INFO: Layer = (63, 63)
+ AX_LINE: Layer = (63, 40)
+ AX_NOME: Layer = (63, 1)
+ AX_NOUS: Layer = (63, 9)
+ AX_NOWG: Layer = (63, 2)
+ AX_NOXX: Layer = (63, 0)
+ AX_TRIP: Layer = (63, 41)
+ AX_WARN: Layer = (63, 42)
+ ME_ALUM_ADD: Layer = (2, 13)
+ ME_ALUM_CPY: Layer = (2, 33)
+ ME_ALUM_LF: Layer = (2, 3)
+ ME_ALUM_SUB: Layer = (2, 23)
+ ME_GOLD_ADD: Layer = (2, 12)
+ ME_GOLD_CPY: Layer = (2, 32)
+ ME_GOLD_LF_C: Layer = (2, 2)
+ ME_GOLD_SUB: Layer = (2, 22)
+ ME_HVIA_ADD: Layer = (2, 14)
+ ME_HVIA_CPY: Layer = (2, 34)
+ ME_HVIA_DF: Layer = (2, 4)
+ ME_HVIA_SUB: Layer = (2, 24)
+ ME_WIPO_ADD: Layer = (2, 16)
+ ME_WIPO_CPY: Layer = (2, 36)
+ ME_WIPO_DF_C: Layer = (2, 6)
+ ME_WIPO_SUB: Layer = (2, 26)
+ ME_WIRE_ADD: Layer = (2, 15)
+ ME_WIRE_CPY: Layer = (2, 35)
+ ME_WIRE_LF: Layer = (2, 5)
+ ME_WIRE_SUB: Layer = (2, 25)
+ NP_NIMP_ADD: Layer = (5, 13)
+ NP_NIMP_CPY: Layer = (5, 33)
+ NP_NIMP_DF: Layer = (5, 3)
+ NP_NIMP_SUB: Layer = (5, 23)
+ NP_PIMP_ADD: Layer = (5, 12)
+ NP_PIMP_CPY: Layer = (5, 32)
+ NP_PIMP_DF: Layer = (5, 2)
+ NP_PIMP_SUB: Layer = (5, 22)
+ WG_ARCO_ADD: Layer = (1, 14)
+ WG_ARCO_CPY: Layer = (1, 34)
+ WG_ARCO_LF: Layer = (1, 4)
+ WG_ARCO_SUB: Layer = (1, 24)
+ WG_DEOX_ADD: Layer = (1, 13)
+ WG_DEOX_CPY: Layer = (1, 33)
+ WG_DEOX_DF: Layer = (1, 3)
+ WG_DEOX_SUB: Layer = (1, 23)
+ WG_LANE_ADD: Layer = (1, 12)
+ WG_LANE_CPY: Layer = (1, 32)
+ WG_LANE_DF: Layer = (1, 2)
+ WG_LANE_SUB: Layer = (1, 22)
+ WG_MOST_ADD: Layer = (1, 11)
+ WG_MOST_CPY: Layer = (1, 31)
+ WG_MOST_DF: Layer = (1, 1)
+ WG_MOST_SUB: Layer = (1, 21)
+ WG_PEDE_ADD: Layer = (1, 16)
+ WG_PEDE_CPY: Layer = (1, 36)
+ WG_PEDE_LF: Layer = (1, 6)
+ WG_PEDE_SUB: Layer = (1, 26)
+ WG_RIBS_ADD: Layer = (1, 10)
+ WG_RIBS_CPY: Layer = (1, 30)
+ WG_RIBS_DF: Layer = (1, 0)
+ WG_RIBS_SUB: Layer = (1, 20)
+ WG_SNGL_ADD: Layer = (1, 15)
+ WG_SNGL_CPY: Layer = (1, 35)
+ WG_SNGL_DF: Layer = (1, 5)
+ WG_SNGL_SUB: Layer = (1, 25)
+
+ # AUX
+ FLOORPLAN: Layer = (63, 98)
+
+ # common gdsfactory layers
+ LABEL_INSTANCE: Layer = (66, 0)
+ DEVREC: Layer = (68, 0)
+ PORT: Layer = (99, 10)
+ PORTE: Layer = (99, 11)
+ TE: Layer = (203, 0)
+ TM: Layer = (204, 0)
+ TEXT: Layer = (66, 0)
+
+ class Config:
+ frozen = True
+ extra = "forbid"
+
+
+LAYER = LayerMap()
+
+
+if __name__ == "__main__":
+ import gdsfactory as gf
+ from gdsfactory.technology.klayout_tech import KLayoutTechnology
+ from gvtt.config import PATH
+
+ # from gdsfactory.technology import lyp_to_dataclass
+
+ # layers = lyp_to_dataclass(PATH.lyp)
+ # print(layers)
+ LAYER_VIEWS = gf.technology.LayerViews(filepath=PATH.lyp)
+ LAYER_VIEWS.to_yaml(PATH.lyp_yaml)
+ t = KLayoutTechnology(
+ name="VTT",
+ layer_map=dict(LAYER),
+ layer_views=LAYER_VIEWS,
+ # layer_stack=LAYER_STACK,
+ # connectivity=connectivity,
+ )
+ t.write_tech(tech_dir=PATH.tech_dir)
+ # print(LAYER)
diff --git a/gvtt/layers.yaml b/gvtt/layers.yaml
new file mode 100644
index 0000000..9725bc4
--- /dev/null
+++ b/gvtt/layers.yaml
@@ -0,0 +1,202 @@
+LayerViews:
+ WG_RIBS_ADD:
+ layer: [1, 10]
+ color: "#262262"
+ WG_MOST_ADD:
+ layer: [1, 11]
+ color: "#00aeef"
+ WG_LANE_ADD:
+ layer: [1, 12]
+ color: "#aa9011"
+ WG_DEOX_ADD:
+ layer: [1, 13]
+ color: "#ef4036"
+ WG_ARCO_ADD:
+ layer: [1, 14]
+ color: "#92278f"
+ WG_SNGL_ADD:
+ layer: [1, 15]
+ color: "#00a651"
+ WG_PEDE_ADD:
+ layer: [1, 16]
+ color: "#8b5e3b"
+ WG_RIBS_SUB:
+ layer: [1, 20]
+ color: "#191741"
+ WG_MOST_SUB:
+ layer: [1, 21]
+ color: "#008bbe"
+ WG_LANE_SUB:
+ layer: [1, 22]
+ color: "#7e6b0d"
+ WG_DEOX_SUB:
+ layer: [1, 23]
+ color: "#e61e12"
+ WG_ARCO_SUB:
+ layer: [1, 24]
+ color: "#6c1d69"
+ WG_SNGL_SUB:
+ layer: [1, 25]
+ color: "#00773a"
+ WG_PEDE_SUB:
+ layer: [1, 26]
+ color: "#69472c"
+ WG_RIBS_CPY:
+ layer: [1, 30]
+ color: "#9792d9"
+ WG_MOST_CPY:
+ layer: [1, 31]
+ color: "#a7e7ff"
+ WG_LANE_CPY:
+ layer: [1, 32]
+ color: "#f5e598"
+ WG_DEOX_CPY:
+ layer: [1, 33]
+ color: "#fac5c2"
+ WG_ARCO_CPY:
+ layer: [1, 34]
+ color: "#e7a5e5"
+ WG_SNGL_CPY:
+ layer: [1, 35]
+ color: "#82ffbf"
+ WG_PEDE_CPY:
+ layer: [1, 36]
+ color: "#dfc7b4"
+ ME_GOLD_ADD:
+ layer: [2, 12]
+ color: "#aa9011"
+ ME_ALUM_ADD:
+ layer: [2, 13]
+ color: "#ef4036"
+ ME_HVIA_ADD:
+ layer: [2, 14]
+ color: "#92278f"
+ ME_WIRE_ADD:
+ layer: [2, 15]
+ color: "#00a651"
+ ME_WIPO_ADD:
+ layer: [2, 16]
+ color: "#8b5e3b"
+ ME_GOLD_SUB:
+ layer: [2, 22]
+ color: "#7e6b0d"
+ ME_ALUM_SUB:
+ layer: [2, 23]
+ color: "#e61e12"
+ ME_HVIA_SUB:
+ layer: [2, 24]
+ color: "#6c1d69"
+ ME_WIRE_SUB:
+ layer: [2, 25]
+ color: "#00773a"
+ ME_WIPO_SUB:
+ layer: [2, 26]
+ color: "#69472c"
+ ME_GOLD_CPY:
+ layer: [2, 32]
+ color: "#f5e598"
+ ME_ALUM_CPY:
+ layer: [2, 33]
+ color: "#fac5c2"
+ ME_HVIA_CPY:
+ layer: [2, 34]
+ color: "#e7a5e5"
+ ME_WIRE_CPY:
+ layer: [2, 35]
+ color: "#82ffbf"
+ ME_WIPO_CPY:
+ layer: [2, 36]
+ color: "#dfc7b4"
+ NP_PIMP_ADD:
+ layer: [5, 12]
+ color: "#aa9011"
+ NP_NIMP_ADD:
+ layer: [5, 13]
+ color: "#ef4036"
+ NP_PIMP_SUB:
+ layer: [5, 22]
+ color: "#7e6b0d"
+ NP_NIMP_SUB:
+ layer: [5, 23]
+ color: "#e61e12"
+ NP_PIMP_CPY:
+ layer: [5, 32]
+ color: "#f5e598"
+ NP_NIMP_CPY:
+ layer: [5, 33]
+ color: "#fac5c2"
+ AX_NOXX:
+ layer: [63, 0]
+ color: "#262262"
+ AX_NOME:
+ layer: [63, 1]
+ color: "#00aeef"
+ AX_NOWG:
+ layer: [63, 2]
+ color: "#aa9011"
+ AX_NOUS:
+ layer: [63, 9]
+ color: "#f1592a"
+ AX_BBOX:
+ layer: [63, 10]
+ color: "#262262"
+ AX_BVIZ:
+ layer: [63, 11]
+ color: "#00aeef"
+ AX_BPIN:
+ layer: [63, 12]
+ color: "#aa9011"
+ AX_LINE:
+ layer: [63, 40]
+ color: "#262262"
+ AX_TRIP:
+ layer: [63, 41]
+ color: "#00aeef"
+ AX_WARN:
+ layer: [63, 42]
+ color: "#aa9011"
+ AX_INFO:
+ layer: [63, 63]
+ color: "#ef4036"
+ WG_RIBS_DF:
+ layer: [1, 0]
+ color: "#262262"
+ WG_MOST_DF:
+ layer: [1, 1]
+ color: "#00aeef"
+ WG_LANE_DF:
+ layer: [1, 2]
+ color: "#aa9011"
+ WG_DEOX_DF:
+ layer: [1, 3]
+ color: "#ef4036"
+ WG_ARCO_LF:
+ layer: [1, 4]
+ color: "#92278f"
+ WG_SNGL_DF:
+ layer: [1, 5]
+ color: "#00a651"
+ WG_PEDE_LF:
+ layer: [1, 6]
+ color: "#8b5e3b"
+ ME_GOLD_LF_C:
+ layer: [2, 2]
+ color: "#aa9011"
+ ME_ALUM_LF:
+ layer: [2, 3]
+ color: "#ef4036"
+ ME_HVIA_DF:
+ layer: [2, 4]
+ color: "#92278f"
+ ME_WIRE_LF:
+ layer: [2, 5]
+ color: "#00a651"
+ ME_WIPO_DF_C:
+ layer: [2, 6]
+ color: "#8b5e3b"
+ NP_PIMP_DF:
+ layer: [5, 2]
+ color: "#aa9011"
+ NP_NIMP_DF:
+ layer: [5, 3]
+ color: "#ef4036"
diff --git a/vtt_tech_public/vtt-layer-list.yaml b/gvtt/vtt-layer-list.yaml
similarity index 100%
rename from vtt_tech_public/vtt-layer-list.yaml
rename to gvtt/vtt-layer-list.yaml
diff --git a/vtt_tech_public/xsections.py b/gvtt/xsections.py
similarity index 93%
rename from vtt_tech_public/xsections.py
rename to gvtt/xsections.py
index 2f13827..641a28f 100644
--- a/vtt_tech_public/xsections.py
+++ b/gvtt/xsections.py
@@ -10,14 +10,14 @@
xsection,
Section,
)
-from .layers import LAYER
+from gvtt.layers import LAYER
@xsection
def rib(
width: float = 2.5,
width_trench: float = 10.0,
- wg_marking_layer: Optional[LayerSpec] = LAYER.TYPE_RIB,
+ wg_marking_layer: LayerSpec = LAYER.TYPE_RIB,
**kwargs,
) -> CrossSection:
"""Return CrossSection of rib waveguide defined by trenches."""
@@ -46,7 +46,7 @@ def rib(
def strip(
width: float = 1.875,
width_trench: float = 10.0,
- wg_marking_layer: Optional[LayerSpec] = LAYER.TYPE_STRIP,
+ wg_marking_layer: LayerSpec = LAYER.TYPE_STRIP,
**kwargs,
) -> CrossSection:
"""Return CrossSection of strip waveguide defined by trenches."""
@@ -114,8 +114,9 @@ def vttstrip(
sm_rib = rib(width=2.5)
euler_strip = strip(width=1.875)
-
cross_sections = get_cross_section_factories(sys.modules[__name__])
if __name__ == "__main__":
print(cross_sections.keys())
+ c = gf.components.straight(cross_section=rib)
+ c.show()
diff --git a/install_tech.py b/install_tech.py
new file mode 100644
index 0000000..43f49b4
--- /dev/null
+++ b/install_tech.py
@@ -0,0 +1,40 @@
+"""Symlink tech to klayout."""
+import sys
+import os
+import shutil
+import pathlib
+
+
+def remove_path_or_dir(dest: pathlib.Path):
+ if dest.is_dir():
+ os.unlink(dest)
+ else:
+ os.remove(dest)
+
+
+def make_link(src, dest, overwrite: bool = True) -> None:
+ dest = pathlib.Path(dest)
+ if dest.exists() and not overwrite:
+ print(f"{dest} already exists")
+ return
+ if dest.exists() or dest.is_symlink():
+ print(f"removing {dest} already installed")
+ remove_path_or_dir(dest)
+ try:
+ os.symlink(src, dest, target_is_directory=True)
+ except OSError:
+ shutil.copy(src, dest)
+ print("link made:")
+ print(f"From: {src}")
+ print(f"To: {dest}")
+
+
+if __name__ == "__main__":
+ klayout_folder = "KLayout" if sys.platform == "win32" else ".klayout"
+ cwd = pathlib.Path(__file__).resolve().parent
+ home = pathlib.Path.home()
+ src = cwd / "gvtt" / "klayout"
+ dest_folder = home / klayout_folder / "tech"
+ dest_folder.mkdir(exist_ok=True, parents=True)
+ dest = dest_folder / "vtt"
+ make_link(src=src, dest=dest)
diff --git a/klayout/layer-list-VTT-PDK.lyp b/klayout/layer-list-VTT-PDK.lyp
deleted file mode 100644
index 791165b..0000000
--- a/klayout/layer-list-VTT-PDK.lyp
+++ /dev/null
@@ -1,948 +0,0 @@
-
-
-
-
- #262262
- #262262
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_RIBS_ADD
- 1/10@*
-
-
- #00aeef
- #00aeef
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_MOST_ADD
- 1/11@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_LANE_ADD
- 1/12@*
-
-
- #ef4036
- #ef4036
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_DEOX_ADD
- 1/13@*
-
-
- #92278f
- #92278f
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_ARCO_ADD
- 1/14@*
-
-
- #00a651
- #00a651
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_SNGL_ADD
- 1/15@*
-
-
- #8b5e3b
- #8b5e3b
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_PEDE_ADD
- 1/16@*
-
-
- #191741
- #191741
- 0
- 0
- I2
- true
- false
-
- false
- 0
- WG_RIBS_SUB
- 1/20@*
-
-
- #008bbe
- #008bbe
- 0
- 0
- I2
- true
- false
-
- false
- 0
- WG_MOST_SUB
- 1/21@*
-
-
- #7e6b0d
- #7e6b0d
- 0
- 0
- I2
- true
- false
-
- false
- 0
- WG_LANE_SUB
- 1/22@*
-
-
- #e61e12
- #e61e12
- 0
- 0
- I2
- true
- false
-
- false
- 0
- WG_DEOX_SUB
- 1/23@*
-
-
- #6c1d69
- #6c1d69
- 0
- 0
- I2
- true
- false
-
- false
- 0
- WG_ARCO_SUB
- 1/24@*
-
-
- #00773a
- #00773a
- 0
- 0
- I2
- true
- false
-
- false
- 0
- WG_SNGL_SUB
- 1/25@*
-
-
- #69472c
- #69472c
- 0
- 0
- I2
- true
- false
-
- false
- 0
- WG_PEDE_SUB
- 1/26@*
-
-
- #9792d9
- #9792d9
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_RIBS_CPY
- 1/30@*
-
-
- #a7e7ff
- #a7e7ff
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_MOST_CPY
- 1/31@*
-
-
- #f5e598
- #f5e598
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_LANE_CPY
- 1/32@*
-
-
- #fac5c2
- #fac5c2
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_DEOX_CPY
- 1/33@*
-
-
- #e7a5e5
- #e7a5e5
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_ARCO_CPY
- 1/34@*
-
-
- #82ffbf
- #82ffbf
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_SNGL_CPY
- 1/35@*
-
-
- #dfc7b4
- #dfc7b4
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_PEDE_CPY
- 1/36@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_GOLD_ADD
- 2/12@*
-
-
- #ef4036
- #ef4036
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_ALUM_ADD
- 2/13@*
-
-
- #92278f
- #92278f
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_HVIA_ADD
- 2/14@*
-
-
- #00a651
- #00a651
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_WIRE_ADD
- 2/15@*
-
-
- #8b5e3b
- #8b5e3b
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_WIPO_ADD
- 2/16@*
-
-
- #7e6b0d
- #7e6b0d
- 0
- 0
- I2
- true
- false
-
- false
- 0
- ME_GOLD_SUB
- 2/22@*
-
-
- #e61e12
- #e61e12
- 0
- 0
- I2
- true
- false
-
- false
- 0
- ME_ALUM_SUB
- 2/23@*
-
-
- #6c1d69
- #6c1d69
- 0
- 0
- I2
- true
- false
-
- false
- 0
- ME_HVIA_SUB
- 2/24@*
-
-
- #00773a
- #00773a
- 0
- 0
- I2
- true
- false
-
- false
- 0
- ME_WIRE_SUB
- 2/25@*
-
-
- #69472c
- #69472c
- 0
- 0
- I2
- true
- false
-
- false
- 0
- ME_WIPO_SUB
- 2/26@*
-
-
- #f5e598
- #f5e598
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_GOLD_CPY
- 2/32@*
-
-
- #fac5c2
- #fac5c2
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_ALUM_CPY
- 2/33@*
-
-
- #e7a5e5
- #e7a5e5
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_HVIA_CPY
- 2/34@*
-
-
- #82ffbf
- #82ffbf
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_WIRE_CPY
- 2/35@*
-
-
- #dfc7b4
- #dfc7b4
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_WIPO_CPY
- 2/36@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- NP_PIMP_ADD
- 5/12@*
-
-
- #ef4036
- #ef4036
- 0
- 0
- I4
- true
- false
-
- false
- 0
- NP_NIMP_ADD
- 5/13@*
-
-
- #7e6b0d
- #7e6b0d
- 0
- 0
- I2
- true
- false
-
- false
- 0
- NP_PIMP_SUB
- 5/22@*
-
-
- #e61e12
- #e61e12
- 0
- 0
- I2
- true
- false
-
- false
- 0
- NP_NIMP_SUB
- 5/23@*
-
-
- #f5e598
- #f5e598
- 0
- 0
- I4
- true
- false
-
- false
- 0
- NP_PIMP_CPY
- 5/32@*
-
-
- #fac5c2
- #fac5c2
- 0
- 0
- I4
- true
- false
-
- false
- 0
- NP_NIMP_CPY
- 5/33@*
-
-
- #262262
- #262262
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_NOXX
- 63/0@*
-
-
- #00aeef
- #00aeef
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_NOME
- 63/1@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_NOWG
- 63/2@*
-
-
- #f1592a
- #f1592a
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_NOUS
- 63/9@*
-
-
- #262262
- #262262
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_BBOX
- 63/10@*
-
-
- #00aeef
- #00aeef
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_BVIZ
- 63/11@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_BPIN
- 63/12@*
-
-
- #262262
- #262262
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_LINE
- 63/40@*
-
-
- #00aeef
- #00aeef
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_TRIP
- 63/41@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_WARN
- 63/42@*
-
-
- #ef4036
- #ef4036
- 0
- 0
- I4
- true
- false
-
- false
- 0
- AX_INFO
- 63/63@*
-
- Source
-
-
-
- #262262
- #262262
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_RIBS (DF)
- 1/0@*
-
-
- #00aeef
- #00aeef
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_MOST (DF)
- 1/1@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_LANE (DF)
- 1/2@*
-
-
- #ef4036
- #ef4036
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_DEOX (DF)
- 1/3@*
-
-
- #92278f
- #92278f
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_ARCO (LF)
- 1/4@*
-
-
- #00a651
- #00a651
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_SNGL (DF)
- 1/5@*
-
-
- #8b5e3b
- #8b5e3b
- 0
- 0
- I4
- true
- false
-
- false
- 0
- WG_PEDE (LF)
- 1/6@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_GOLD (LF) (C)
- 2/2@*
-
-
- #ef4036
- #ef4036
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_ALUM (LF)
- 2/3@*
-
-
- #92278f
- #92278f
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_HVIA (DF)
- 2/4@*
-
-
- #00a651
- #00a651
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_WIRE (LF)
- 2/5@*
-
-
- #8b5e3b
- #8b5e3b
- 0
- 0
- I4
- true
- false
-
- false
- 0
- ME_WIPO (DF) (C)
- 2/6@*
-
-
- #aa9011
- #aa9011
- 0
- 0
- I4
- true
- false
-
- false
- 0
- NP_PIMP (DF)
- 5/2@*
-
-
- #ef4036
- #ef4036
- 0
- 0
- I4
- true
- false
-
- false
- 0
- NP_NIMP (DF)
- 5/3@*
-
- Final
-
-
-
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..e08224d
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,142 @@
+# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
+[build-system]
+requires = ["flit_core >=3.2,<4"]
+build-backend = "flit_core.buildapi"
+
+[project]
+name="gvtt"
+description="gdsfactory VTT PDK"
+classifiers = [
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Operating System :: OS Independent",
+]
+version="0.0.1"
+authors = [{name = "gdsfactory community", email = "contact@gdsfactory.com"}]
+keywords = ["python"]
+license = {file = "LICENSE"}
+dependencies = [
+ "gdsfactory==6.113.0",
+]
+readme = "README.md"
+requires-python = ">=3.10"
+
+[project.optional-dependencies]
+dev = [
+ "gdsfactory[full]==6.113.0",
+ "pre-commit",
+ "pytest",
+ "pytest-cov",
+ "pytest_regressions",
+ ]
+docs = [
+ "jupytext",
+ "autodoc_pydantic",
+ "matplotlib",
+ "jupyter-book==0.15.1",
+ "sphinx-autodoc-typehints",
+ "sphinx-click",
+ ]
+
+
+[tool.setuptools.packages]
+find = {}
+
+
+[tool.black]
+line-length = 88
+target-version = ['py310']
+include = '\.pyi?$'
+exclude = ''' # Specify the files/dirs that should be ignored by the black formatter
+/(
+ \.eggs
+ | \.git
+ | \.hg
+ | \.mypy_cache
+ | \.tox
+ | \.venv
+ | env
+ | _build
+ | buck-out
+ | build
+ | dist
+)/
+'''
+
+[tool.pytest.ini_options]
+testpaths = ["gvtt/", "tests"]
+# addopts = --tb=no
+addopts = '--tb=short'
+python_files = ["gvtt/*.py", "notebooks/*.ipynb", "tests/*.py"]
+norecursedirs = ["extra/*.py"]
+
+[tool.flake8]
+max-line-length = 88
+max-complexity = 57
+select = ["B","C","E","F","W","T4","B9"]
+ignore = [ "E501", "E503", "E722", "W503", "W503", "E203", "B950", "B305", "B018", "B902", "B020", "B905"]
+extend-ignore = "RST303"
+
+exclude = [
+ ".git",
+ "__pycache__",
+ "lib",
+ "docs/source/conf.py",
+ "build",
+ "dist",
+ ".ipynb_checkpoints",
+ ".tox",
+ "extra",
+ "deprecated",
+ ".mypy_cache",
+ "venv",
+ "devsim"
+ ]
+
+[tool.commitizen]
+name = "cz_conventional_commits"
+version = "0.1.0"
+version_files = [
+ "pyproject.toml:version",
+]
+
+[tool.mypy]
+python_version = "3.10"
+strict = true
+
+[tool.pylsp-mypy]
+enabled = true
+live_mode = true
+strict = true
+
+[tool.isort]
+multi_line_output = 3
+line_length = 88
+include_trailing_comma = true
+# skip = "gvtt/__init__.py"
+
+[tool.setuptools.package-data]
+mypkg = ["*.csv", "*.yaml"]
+
+[tool.pydocstyle]
+inherit = false
+match = "(?!test).*\\.py"
+add-ignore = ["D100","D101","D102","D103","D104","D203","D405","D417"]
+convention = "google"
+
+[tool.ruff]
+select = [
+ "E", # pycodestyle errors
+ "W", # pycodestyle warnings
+ "F", # pyflakes
+ # "I", # isort
+ "C", # flake8-comprehensions
+ "B", # flake8-bugbear
+]
+ignore = [
+ "E501", # line too long, handled by black
+ "B008", # do not perform function calls in argument defaults
+ "C901", # too complex
+ "B905", # `zip()` without an explicit `strict=` parameter
+ "C408", # C408 Unnecessary `dict` call (rewrite as a literal)
+]
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 9358029..0000000
--- a/setup.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from setuptools import setup, find_packages
-
-setup(
- name="vtt_tech_public",
- version="0.1",
- packages=find_packages(),
- include_package_data=True,
-)
diff --git a/tests/ref/bend_euler.gds b/tests/ref/bend_euler.gds
new file mode 100644
index 0000000..872d260
Binary files /dev/null and b/tests/ref/bend_euler.gds differ
diff --git a/tests/ref/die.gds b/tests/ref/die.gds
new file mode 100644
index 0000000..993f8b8
Binary files /dev/null and b/tests/ref/die.gds differ
diff --git a/tests/ref/edge_coupler_rib.gds b/tests/ref/edge_coupler_rib.gds
new file mode 100644
index 0000000..e1ee42f
Binary files /dev/null and b/tests/ref/edge_coupler_rib.gds differ
diff --git a/tests/ref/mmi1x2_1e450ddf.gds b/tests/ref/mmi1x2_1e450ddf.gds
new file mode 100644
index 0000000..ae3225a
Binary files /dev/null and b/tests/ref/mmi1x2_1e450ddf.gds differ
diff --git a/tests/ref/mmi2x2_426a4478.gds b/tests/ref/mmi2x2_426a4478.gds
new file mode 100644
index 0000000..f183fb5
Binary files /dev/null and b/tests/ref/mmi2x2_426a4478.gds differ
diff --git a/tests/ref/rib_taper.gds b/tests/ref/rib_taper.gds
new file mode 100644
index 0000000..332fd29
Binary files /dev/null and b/tests/ref/rib_taper.gds differ
diff --git a/tests/ref/rib_to_strip.gds b/tests/ref/rib_to_strip.gds
new file mode 100644
index 0000000..cecd73c
Binary files /dev/null and b/tests/ref/rib_to_strip.gds differ
diff --git a/tests/ref/strip_taper.gds b/tests/ref/strip_taper.gds
new file mode 100644
index 0000000..f1b8a0b
Binary files /dev/null and b/tests/ref/strip_taper.gds differ
diff --git a/tests/ref/strip_to_rib.gds b/tests/ref/strip_to_rib.gds
new file mode 100644
index 0000000..b2e6768
Binary files /dev/null and b/tests/ref/strip_to_rib.gds differ
diff --git a/tests/test_components.py b/tests/test_components.py
new file mode 100644
index 0000000..c971bbd
--- /dev/null
+++ b/tests/test_components.py
@@ -0,0 +1,33 @@
+import pathlib
+import pytest
+from pytest_regressions.data_regression import DataRegressionFixture
+
+from gdsfactory.component import Component
+from gdsfactory.difftest import difftest
+from gvtt import cells
+
+
+skip_test = {}
+cell_names = set(cells.keys()) - set(skip_test)
+dirpath_ref = pathlib.Path(__file__).absolute().parent / "ref"
+
+
+@pytest.fixture(params=cell_names, scope="function")
+def component(request) -> Component:
+ return cells[request.param]()
+
+
+def test_pdk_gds(component: Component) -> None:
+ """Avoid regressions in GDS geometry, cell names and layers."""
+ difftest(component, dirpath=dirpath_ref)
+
+
+def test_pdk_settings(
+ component: Component, data_regression: DataRegressionFixture
+) -> None:
+ """Avoid regressions when exporting settings."""
+ data_regression.check(component.to_dict())
+
+
+# def test_assert_ports_on_grid(component: Component):
+# component.assert_ports_on_grid()
diff --git a/tests/test_components/test_pdk_settings_bend_euler_.yml b/tests/test_components/test_pdk_settings_bend_euler_.yml
new file mode 100644
index 0000000..6d13d6d
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_bend_euler_.yml
@@ -0,0 +1,62 @@
+name: bend_euler
+ports:
+ o1:
+ center:
+ - 0.0
+ - 0.0
+ layer:
+ - 89
+ - 1
+ name: o1
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+ o2:
+ center:
+ - 100.379
+ - 100.379
+ layer:
+ - 89
+ - 1
+ name: o2
+ orientation: 90
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+settings:
+ changed: {}
+ child: null
+ default:
+ angle: 90.0
+ cross_section: strip
+ direction: ccw
+ npoints: null
+ p: 1.0
+ with_arc_floorplan: false
+ with_bbox: true
+ full:
+ angle: 90.0
+ cross_section: strip
+ direction: ccw
+ npoints: null
+ p: 1.0
+ with_arc_floorplan: false
+ with_bbox: true
+ function_name: bend_euler
+ info:
+ dy: 100.379
+ function_name: strip
+ length: 168.628
+ radius: 100.379
+ radius_min: 53.676
+ settings:
+ wg_marking_layer:
+ - 89
+ - 1
+ width: 1.875
+ width_trench: 10.0
+ width: 1.875
+ info_version: 2
+ module: gvtt.components.bend_euler
+ name: bend_euler
diff --git a/tests/test_components/test_pdk_settings_die_.yml b/tests/test_components/test_pdk_settings_die_.yml
new file mode 100644
index 0000000..a56081d
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_die_.yml
@@ -0,0 +1,44 @@
+name: die
+ports: {}
+settings:
+ changed: {}
+ child: null
+ default:
+ bbox_layer: null
+ die_name: chip99
+ draw_corners: true
+ draw_dicing_lane: true
+ layer: null
+ size:
+ - 5000.0
+ - 9500.0
+ street_length: 1000.0
+ street_width: 75.0
+ text_component:
+ function: text
+ text_location: SW
+ text_size: 100.0
+ full:
+ bbox_layer: null
+ die_name: chip99
+ draw_corners: true
+ draw_dicing_lane: true
+ layer: null
+ size:
+ - 5000.0
+ - 9500.0
+ street_length: 1000.0
+ street_width: 75.0
+ text_component:
+ function: text
+ text_location: SW
+ text_size: 100.0
+ function_name: die
+ info:
+ port_x_position_east: 2423.5
+ port_x_position_west: -2423.5
+ port_y_position_north: 4673.5
+ port_y_position_south: -4673.5
+ info_version: 2
+ module: gvtt.components.die
+ name: die
diff --git a/tests/test_components/test_pdk_settings_edge_coupler_rib_.yml b/tests/test_components/test_pdk_settings_edge_coupler_rib_.yml
new file mode 100644
index 0000000..cb40145
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_edge_coupler_rib_.yml
@@ -0,0 +1,34 @@
+name: edge_coupler_rib
+ports:
+ o1:
+ center:
+ - 25.0
+ - 0.0
+ layer:
+ - 89
+ - 0
+ name: o1
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 3.0
+settings:
+ changed: {}
+ child: null
+ default:
+ edge_coupling_width: 3.0
+ polishing_length: 25.0
+ side: W
+ xpos: 0.0
+ ypos: 0.0
+ full:
+ edge_coupling_width: 3.0
+ polishing_length: 25.0
+ side: W
+ xpos: 0.0
+ ypos: 0.0
+ function_name: edge_coupler_rib
+ info: {}
+ info_version: 2
+ module: gvtt.components.edge_coupler_rib
+ name: edge_coupler_rib
diff --git a/tests/test_components/test_pdk_settings_mmi1x2_.yml b/tests/test_components/test_pdk_settings_mmi1x2_.yml
new file mode 100644
index 0000000..d300b28
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_mmi1x2_.yml
@@ -0,0 +1,78 @@
+name: mmi1x2_1e450ddf
+ports:
+ o1:
+ center:
+ - -10.0
+ - 0.0
+ layer:
+ - 89
+ - 1
+ name: o1
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+ o2:
+ center:
+ - 53.25
+ - 1.562
+ layer:
+ - 89
+ - 1
+ name: o2
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+ o3:
+ center:
+ - 53.25
+ - -1.562
+ layer:
+ - 89
+ - 1
+ name: o3
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+settings:
+ changed:
+ cross_section:
+ function: strip
+ gap_mmi: 1.25
+ length_mmi: 43.25
+ length_taper: 1.0
+ taper:
+ function: strip_taper
+ width_mmi: 6.25
+ width_taper: 1.875
+ child: null
+ default:
+ cross_section: strip
+ gap_mmi: 0.25
+ length_mmi: 5.5
+ length_taper: 10.0
+ taper:
+ function: taper
+ width: null
+ width_mmi: 2.5
+ width_taper: 1.0
+ with_bbox: true
+ full:
+ cross_section:
+ function: strip
+ gap_mmi: 1.25
+ length_mmi: 43.25
+ length_taper: 1.0
+ taper:
+ function: strip_taper
+ width: null
+ width_mmi: 6.25
+ width_taper: 1.875
+ with_bbox: true
+ function_name: mmi1x2
+ info: {}
+ info_version: 2
+ module: gdsfactory.components.mmi1x2
+ name: mmi1x2_1e450ddf
diff --git a/tests/test_components/test_pdk_settings_mmi2x2_.yml b/tests/test_components/test_pdk_settings_mmi2x2_.yml
new file mode 100644
index 0000000..968ca97
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_mmi2x2_.yml
@@ -0,0 +1,94 @@
+name: mmi2x2_426a4478
+ports:
+ o1:
+ center:
+ - -10.0
+ - -1.562
+ layer:
+ - 89
+ - 1
+ name: o1
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+ o2:
+ center:
+ - -10.0
+ - 1.562
+ layer:
+ - 89
+ - 1
+ name: o2
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+ o3:
+ center:
+ - 122.0
+ - 1.562
+ layer:
+ - 89
+ - 1
+ name: o3
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+ o4:
+ center:
+ - 122.0
+ - -1.562
+ layer:
+ - 89
+ - 1
+ name: o4
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 1.875
+settings:
+ changed:
+ cross_section:
+ function: strip
+ gap_mmi: 1.25
+ length_mmi: 112.0
+ length_taper: 1.0
+ taper:
+ function: strip_taper
+ width_mmi: 5.0
+ width_taper: 1.875
+ child: null
+ default:
+ cross_section: strip
+ gap_mmi: 0.25
+ length_mmi: 5.5
+ length_taper: 10.0
+ straight:
+ function: straight
+ taper:
+ function: taper
+ width: null
+ width_mmi: 2.5
+ width_taper: 1.0
+ with_bbox: true
+ full:
+ cross_section:
+ function: strip
+ gap_mmi: 1.25
+ length_mmi: 112.0
+ length_taper: 1.0
+ straight:
+ function: straight
+ taper:
+ function: strip_taper
+ width: null
+ width_mmi: 5.0
+ width_taper: 1.875
+ with_bbox: true
+ function_name: mmi2x2
+ info: {}
+ info_version: 2
+ module: gdsfactory.components.mmi2x2
+ name: mmi2x2_426a4478
diff --git a/tests/test_components/test_pdk_settings_rib_taper_.yml b/tests/test_components/test_pdk_settings_rib_taper_.yml
new file mode 100644
index 0000000..7bd35ef
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_rib_taper_.yml
@@ -0,0 +1,47 @@
+name: rib_taper
+ports:
+ o1:
+ center:
+ - 0.0
+ - 0.0
+ layer:
+ - 89
+ - 0
+ name: o1
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 1.0
+ o2:
+ center:
+ - 0.01
+ - 0.0
+ layer:
+ - 89
+ - 0
+ name: o2
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 1.0
+settings:
+ changed: {}
+ child: null
+ default:
+ length: null
+ taper_ratio: 50.0
+ width1: 1
+ width2: 1
+ full:
+ length: null
+ taper_ratio: 50.0
+ width1: 1
+ width2: 1
+ function_name: rib_taper
+ info:
+ length: 0.01
+ width1: 1.0
+ width2: 1.0
+ info_version: 2
+ module: gvtt.components.transitions
+ name: rib_taper
diff --git a/tests/test_components/test_pdk_settings_rib_to_strip_.yml b/tests/test_components/test_pdk_settings_rib_to_strip_.yml
new file mode 100644
index 0000000..85be39a
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_rib_to_strip_.yml
@@ -0,0 +1,41 @@
+name: rib_to_strip
+ports:
+ o1:
+ center:
+ - 0.0
+ - 0.0
+ layer: null
+ name: o1
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 3.0
+ o2:
+ center:
+ - 200.0
+ - 0.0
+ layer: null
+ name: o2
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 3.0
+settings:
+ changed: {}
+ child: null
+ default:
+ length: 200.0
+ width1: 3.0
+ width2: 3.0
+ full:
+ length: 200.0
+ width1: 3.0
+ width2: 3.0
+ function_name: rib_to_strip
+ info:
+ length: 200.0
+ width1: 3.0
+ width2: 3.0
+ info_version: 2
+ module: gvtt.components.transitions
+ name: rib_to_strip
diff --git a/tests/test_components/test_pdk_settings_strip_taper_.yml b/tests/test_components/test_pdk_settings_strip_taper_.yml
new file mode 100644
index 0000000..f591596
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_strip_taper_.yml
@@ -0,0 +1,47 @@
+name: strip_taper
+ports:
+ o1:
+ center:
+ - 0.0
+ - 0.0
+ layer:
+ - 89
+ - 1
+ name: o1
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 1.0
+ o2:
+ center:
+ - 10.0
+ - 0.0
+ layer:
+ - 89
+ - 1
+ name: o2
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 1.0
+settings:
+ changed: {}
+ child: null
+ default:
+ length: null
+ taper_ratio: 25.0
+ width1: 1
+ width2: 1
+ full:
+ length: null
+ taper_ratio: 25.0
+ width1: 1
+ width2: 1
+ function_name: strip_taper
+ info:
+ length: 0.01
+ width1: 1.0
+ width2: 1.0
+ info_version: 2
+ module: gvtt.components.transitions
+ name: strip_taper
diff --git a/tests/test_components/test_pdk_settings_strip_to_rib_.yml b/tests/test_components/test_pdk_settings_strip_to_rib_.yml
new file mode 100644
index 0000000..28097be
--- /dev/null
+++ b/tests/test_components/test_pdk_settings_strip_to_rib_.yml
@@ -0,0 +1,39 @@
+name: strip_to_rib
+ports:
+ o1:
+ center:
+ - 200.0
+ - 0.0
+ layer: null
+ name: o1
+ orientation: 0.0
+ port_type: optical
+ shear_angle: null
+ width: 3.0
+ o2:
+ center:
+ - 0.0
+ - 0.0
+ layer: null
+ name: o2
+ orientation: 180
+ port_type: optical
+ shear_angle: null
+ width: 3.0
+settings:
+ changed: {}
+ child: null
+ default:
+ width1: 3.0
+ width2: 3.0
+ full:
+ width1: 3.0
+ width2: 3.0
+ function_name: strip_to_rib
+ info:
+ length: 200.0
+ width1: 3.0
+ width2: 3.0
+ info_version: 2
+ module: gvtt.components.transitions
+ name: strip_to_rib
diff --git a/vtt_tech_public/components/__init__.py b/vtt_tech_public/components/__init__.py
deleted file mode 100644
index 5c8e979..0000000
--- a/vtt_tech_public/components/__init__.py
+++ /dev/null
@@ -1,7 +0,0 @@
-from .bend_euler import bend_euler
-from .rib_strip_converter import rib_to_strip, strip_to_rib
-from .rib_strip_converter import rib_taper, strip_taper
-from .die import die
-from .edge_coupler_rib import edge_coupler_rib
-from .mmi1x2 import mmi1x2
-from .mmi2x2 import mmi2x2
diff --git a/vtt_tech_public/components/edge_coupler_rib.py b/vtt_tech_public/components/edge_coupler_rib.py
deleted file mode 100644
index 736938e..0000000
--- a/vtt_tech_public/components/edge_coupler_rib.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import gdsfactory as gf
-from gdsfactory.component import Component
-from vtt_tech_public.xsections import rib
-
-
-@gf.cell
-def edge_coupler_rib(edge_coupling_width : float = 3.0,
- polishing_length: float = 25.0,
- side : str = 'W',
- pos : float = 0.0,
- die: gf.component_reference.ComponentReference = None) -> Component:
-
- c = gf.Component()
- side = side.upper()
-
- if side == 'W':
- ypos = pos
- xpos = die.info['port_x_position_west']
- orientation = 0
- if side == 'E':
- ypos = pos
- xpos = die.info['port_x_position_east']
- orientation = 180
- if side == 'N':
- xpos = pos
- ypos = die.info['port_y_position_north']
- orientation = -90
- if side == 'S':
- xpos = pos
- ypos = die.info['port_y_position_south']
- orientation = 90
-
- ref = c << gf.components.straight(cross_section=rib(edge_coupling_width), length=polishing_length)
- ref.rotate(orientation)
- ref.move((xpos, ypos))
-
- c.add_port('o1', port=ref.ports['o2'])
- c.absorb(ref)
-
- return c
\ No newline at end of file
diff --git a/vtt_tech_public/components/mmi1x2.py b/vtt_tech_public/components/mmi1x2.py
deleted file mode 100644
index 39f5415..0000000
--- a/vtt_tech_public/components/mmi1x2.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import gdsfactory as gf
-from gdsfactory.components import mmi1x2 as _mmi1x2
-from gdsfactory import Component
-from functools import partial
-from vtt_tech_public.xsections import strip
-from vtt_tech_public.components import strip_taper
-
-
-@gf.cell
-def mmi1x2() -> Component:
- return partial(
- _mmi1x2,
- width_mmi=6.25,
- length_mmi=43.25,
- width_taper=1.875,
- cross_section=strip,
- gap_mmi=(6.25 - 2 * 1.875) / 2,
- taper=strip_taper,
- length_taper=1.0,
- )()
diff --git a/vtt_tech_public/components/mmi2x2.py b/vtt_tech_public/components/mmi2x2.py
deleted file mode 100644
index 3231cf0..0000000
--- a/vtt_tech_public/components/mmi2x2.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import gdsfactory as gf
-from gdsfactory.components import mmi2x2 as _mmi2x2
-from gdsfactory import Component
-from functools import partial
-from vtt_tech_public.xsections import strip
-from vtt_tech_public.components import strip_taper
-
-
-@gf.cell
-def mmi2x2() -> Component:
- return partial(
- _mmi2x2,
- width_mmi=5.0,
- length_mmi=112.0,
- width_taper=1.875,
- cross_section=strip,
- gap_mmi=1.25,
- taper=strip_taper,
- length_taper=1.0,
- )()
diff --git a/vtt_tech_public/layers.py b/vtt_tech_public/layers.py
deleted file mode 100644
index 62d19f9..0000000
--- a/vtt_tech_public/layers.py
+++ /dev/null
@@ -1,73 +0,0 @@
-
-import gdsfactory as gf
-from gdsfactory.typings import Layer, LayerLevel, LayerStack
-from pydantic import BaseModel, Extra
-
-import yaml
-
-from vtt_tech_public.config import PATH
-
-class LayerMap(BaseModel):
-
- # waveguide types
- TYPE_RIB: Layer = (89, 0)
- TYPE_STRIP: Layer = (89, 1)
-
- # AUX
- FLOORPLAN: Layer = (63, 98)
-
- # common gdsfactory layers
- LABEL_INSTANCE: Layer = (66, 0)
- DEVREC: Layer = (68, 0)
- PORT: Layer = (99, 10)
- PORTE: Layer = (99, 11)
- TE: Layer = (203, 0)
- TM: Layer = (204, 0)
- TEXT: Layer = (66, 0)
-
- class Config:
- frozen = False
- extra = Extra.allow
-
-LAYER = LayerMap()
-
-# dynamically insert VTT layer entries from a YAML file.
-with open(PATH.layer_lib, 'r') as file:
- data = yaml.safe_load(file)
-
- dadd = data['offsets']['add_offset']
- dsub = data['offsets']['sub_offset']
- dcpy = data['offsets']['cpy_offset']
-
- validate_list = []
-
- for mkey, module in data['modules'].items():
- gds_layer = module['gds_layer']
- for lname, layer in module['layers'].items():
- ld = (gds_layer, layer['datatype'])
- assert ld not in validate_list, f"Duplicate GDS layer/datatype definition for layer f'{mkey}_{lname}"
- validate_list.append(ld)
-
- setattr(LAYER, f'{mkey}_{lname}_ADD', tuple((gds_layer, dadd + layer['datatype'])))
- setattr(LAYER, f'{mkey}_{lname}_SUB', tuple((gds_layer, dsub + layer['datatype'])))
- setattr(LAYER, f'{mkey}_{lname}_CPY', tuple((gds_layer, dcpy + layer['datatype'])))
-
- gds_layer = data['aux']['gds_layer']
- mkey = data['aux']['id']
- for lname, layer in data['aux']['layers'].items():
- ld = (gds_layer, layer['datatype'])
- assert ld not in validate_list, f"Duplicate GDS layer/datatype definition for layer f'{mkey}_{lname}"
- validate_list.append(ld)
-
- setattr(LAYER, f'{mkey}_{lname}', tuple((gds_layer, layer['datatype'])))
-
-# Prevent adding further layer definitions
-LAYER.Config.frozen = True
-LAYER.Config.extra = Extra.forbid
-
-
-#LAYER_VIEWS = gf.technology.LayerViews(filepath=PATH.lyp_yaml)
-
-
-if __name__ == "__main__":
- print(LAYER)
diff --git a/workflows/pages.yml b/workflows/pages.yml
new file mode 100644
index 0000000..5553661
--- /dev/null
+++ b/workflows/pages.yml
@@ -0,0 +1,46 @@
+name: Sphinx docs to gh-pages
+
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ build-docs:
+ runs-on: ubuntu-latest
+ name: Sphinx docs to gh-pages
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Installing the library
+ shell: bash -l {0}
+ run: |
+ make dev
+ - name: make docs
+ run: |
+ make docs
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v1
+ with:
+ path: "./docs/_build/html/"
+ deploy-docs:
+ needs: build-docs
+ permissions:
+ pages: write
+ id-token: write
+
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+
+ runs-on: ubuntu-latest
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v2
diff --git a/workflows/release.yml b/workflows/release.yml
new file mode 100644
index 0000000..8f5fa5d
--- /dev/null
+++ b/workflows/release.yml
@@ -0,0 +1,28 @@
+name: Release PyPI, installers and docker container
+
+on:
+ push:
+ tags: "v*"
+
+jobs:
+ release_pypi:
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.x
+ cache-dependency-path: pyproject.toml
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install setuptools wheel twine
+ - name: Build and publish
+ env:
+ TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
+ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+ run: |
+ make build
+ twine upload dist/*
diff --git a/workflows/test_code.yml b/workflows/test_code.yml
new file mode 100644
index 0000000..b43e269
--- /dev/null
+++ b/workflows/test_code.yml
@@ -0,0 +1,88 @@
+name: Test pre-commit, code and docs
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+
+jobs:
+ pre-commit:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.10"
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Test pre-commit hooks
+ run: |
+ python -m pip install --upgrade pip
+ pip install pre-commit
+ pre-commit run -a
+ test_code:
+ needs: [pre-commit]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ max-parallel: 12
+ matrix:
+ python-version: ["3.10"]
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Install dependencies
+ run: |
+ pip install -e .[tests]
+ - name: Test with pytest
+ run: pytest
+ test_code_coverage:
+ runs-on: ubuntu-latest
+ needs: [pre-commit]
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ - name: Install dependencies
+ run: |
+ pip install -e .[tests]
+ - name: Test with pytest
+ run: |
+ pytest --cov
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v3
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ fail_ci_if_error: false
+ test_docs:
+ needs: [pre-commit]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ max-parallel: 12
+ matrix:
+ python-version: ['3.10']
+ os: [ubuntu-latest]
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ cache: "pip"
+ cache-dependency-path: pyproject.toml
+ - name: Install dependencies
+ run: |
+ make dev
+ - name: Test documentation
+ run: |
+ make docs