diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40993b6a..d0b731f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,27 +1,41 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 9260cbc9c84c06022993bfbcc42fdbf0305c5b8e + rev: v4.6.0 hooks: + - id: check-yaml + exclude: ^(conda\.recipe/meta\.yaml|conda_build/templates/.*\.yaml|docs/click/meta\.yaml|conda/meta\.yaml|conda/construct.yaml|.*\.pic\.yml|conda/constructor/Miniforge3/construct.yaml) - id: end-of-file-fixer - id: trailing-whitespace - - id: requirements-txt-fixer + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + - id: nbstripout + files: ".ipynb" - - repo: https://github.com/psf/black - rev: 25d886f52c2bbbb58386ac8050f4e67952507bc7 + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 hooks: - - id: black + - id: codespell + additional_dependencies: + - tomli - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "6a0ba1854991b693612486cc84a2254de82d071d" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.4.1" hooks: - id: ruff + args: [ --fix, --exit-non-zero-on-fix ] + - id: ruff-format + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.10.0 + rev: v2.13.0 hooks: - id: pretty-format-toml args: [--autofix] - - repo: https://github.com/kynan/nbstripout - rev: e4c5b4dcbab4afa0b88b7a9243db42b1a8d95dde + + - repo: https://github.com/aristanetworks/j2lint.git + rev: v1.1.0 hooks: - - id: nbstripout - files: ".ipynb" + - id: j2lint + types: [file] + files: \.(j2|yml|yaml)$ + exclude: .github/.* diff --git a/docs/notebooks/00_layout.ipynb b/docs/notebooks/00_layout.ipynb index 4957ff67..96e9b140 100644 --- a/docs/notebooks/00_layout.ipynb +++ b/docs/notebooks/00_layout.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9a27187a", + "id": "0", "metadata": {}, "source": [ "# Layout\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e2dfd9b", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "5ff8f212", + "id": "2", "metadata": {}, "source": [ "## Fixed Component cells\n", @@ -36,7 +36,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cff0d620", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1275e6a7", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -58,7 +58,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83c885a0", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c185343", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a235259", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8af49e8a", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -101,7 +101,7 @@ }, { "cell_type": "markdown", - "id": "ccfae4d2", + "id": "9", "metadata": {}, "source": [ "## Parametric Component PCells\n", @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7bff697c", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3891d5ac", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -134,7 +134,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5179d03b", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -145,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "57e8b0f0", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -156,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a962eb0a", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1d9634e", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d348c4c8", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ }, { "cell_type": "markdown", - "id": "f3a3e792", + "id": "17", "metadata": {}, "source": [ "## Components with grating couplers\n", @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6103f4cc", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fe809f5a", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e824506", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e291dcf7", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +245,7 @@ }, { "cell_type": "markdown", - "id": "61e47076", + "id": "22", "metadata": {}, "source": [ "## 3D rendering" @@ -254,7 +254,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4c9f5cb", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "420144d7", + "id": "24", "metadata": {}, "source": [ "## Die assembly" @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4daec89a", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -326,7 +326,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ed290ae", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -372,7 +372,7 @@ { "cell_type": "code", "execution_count": null, - "id": "581be784", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f64b8df0", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ { "cell_type": "code", "execution_count": null, - "id": "525a1c3e", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -460,7 +460,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24c91ab4", + "id": "30", "metadata": {}, "outputs": [], "source": [] diff --git a/docs/notebooks/11_sparameters.ipynb b/docs/notebooks/11_sparameters.ipynb index 96dc13bf..38d55790 100644 --- a/docs/notebooks/11_sparameters.ipynb +++ b/docs/notebooks/11_sparameters.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ec56317b", + "id": "0", "metadata": {}, "source": [ "# Component FDTD simulations\n", @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "d6c52ae2", + "id": "1", "metadata": {}, "source": [ "Meep is open source, so you won't need a license, but for tidy3d or Lumerical you'll need to have a license.\n", @@ -31,7 +31,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eee58fc5", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7ea17912", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aef763d9", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "97685b47", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e950a444", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4186d09", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "430416f2", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "ef830dfa", + "id": "9", "metadata": {}, "source": [ "## Lumerical FDTD\n", @@ -115,7 +115,7 @@ }, { "cell_type": "markdown", - "id": "8042e020", + "id": "10", "metadata": {}, "source": [ "To run simulations uncomment the following lines" @@ -124,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10ee1b6b", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f9bb4cff", + "id": "12", "metadata": { "lines_to_next_cell": 2 }, @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5770b2f0", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -167,7 +167,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f16de245", + "id": "14", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/notebooks/11_sparameters_gratings.ipynb b/docs/notebooks/11_sparameters_gratings.ipynb index dcda1dfe..26602e21 100644 --- a/docs/notebooks/11_sparameters_gratings.ipynb +++ b/docs/notebooks/11_sparameters_gratings.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ae73677e", + "id": "0", "metadata": {}, "source": [ "# Grating coupler FDTD simulations\n", @@ -17,7 +17,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35dbffc3", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -35,7 +35,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ad9cf15", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbf6ee2a", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "666a4c36", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -76,7 +76,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f188d5d", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eb904eb9", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -109,7 +109,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5cf70004", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -119,7 +119,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca02dea5", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e3cd5169", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "285f61c1", + "id": "10", "metadata": {}, "outputs": [], "source": [] @@ -165,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e483fdd", + "id": "11", "metadata": {}, "outputs": [], "source": [] diff --git a/docs/notebooks/12_sim_plugins_tidy3d.ipynb b/docs/notebooks/12_sim_plugins_tidy3d.ipynb index 791e35ef..06200345 100644 --- a/docs/notebooks/12_sim_plugins_tidy3d.ipynb +++ b/docs/notebooks/12_sim_plugins_tidy3d.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "858e2776", + "id": "0", "metadata": {}, "source": [ "# Circuit simulations (tidy3d + SAX)\n", @@ -20,7 +20,7 @@ }, { "cell_type": "markdown", - "id": "a888aa47", + "id": "1", "metadata": {}, "source": [ "## tidy3d FDTD simulations\n", @@ -37,7 +37,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62bbb0fc", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -52,7 +52,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51cc610b", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9fad97fe", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5c9218a", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bb8bc8b", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +92,7 @@ }, { "cell_type": "markdown", - "id": "b65bd15c", + "id": "7", "metadata": {}, "source": [ "## Circuit simulation\n" @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c93e9644", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -112,7 +112,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3379d1dc", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +127,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5cd4e2ad", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -143,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a34d0b8f", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6cd95df3", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -171,7 +171,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a68660b", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +189,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a130b05", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -200,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d989144f", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "083e45ef", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4c38679", + "id": "17", "metadata": {}, "outputs": [], "source": [] @@ -244,7 +244,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5e44e25", + "id": "18", "metadata": {}, "outputs": [], "source": [] diff --git a/docs/notebooks/14_sax_tidy3d.ipynb b/docs/notebooks/14_sax_tidy3d.ipynb index d89a883c..b119c296 100644 --- a/docs/notebooks/14_sax_tidy3d.ipynb +++ b/docs/notebooks/14_sax_tidy3d.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "a5ddc7f6", + "id": "0", "metadata": {}, "source": [ "# SAX circuit simulator\n", @@ -21,7 +21,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4880dc93", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -39,7 +39,7 @@ }, { "cell_type": "markdown", - "id": "b062aeb3", + "id": "2", "metadata": {}, "source": [ "## Scatter *dictionaries*\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7bfe139e", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "6a5e26de", + "id": "4", "metadata": {}, "source": [ " it can still be tedious to specify every port in the circuit manually. SAX therefore offers the `reciprocal` function, which auto-fills the reverse connection if the forward connection exist. For example:" @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2e01d762", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -110,7 +110,7 @@ }, { "cell_type": "markdown", - "id": "66f9611c", + "id": "6", "metadata": { "lines_to_next_cell": 2 }, @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d124c4b8", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "246f2915", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "markdown", - "id": "785f3311", + "id": "9", "metadata": {}, "source": [ "### Waveguide model\n", @@ -175,7 +175,7 @@ }, { "cell_type": "markdown", - "id": "799b714c", + "id": "10", "metadata": {}, "source": [ "Lets compute the effective index `neff` and group index `ng` for a 1550nm 500nm straight waveguide" @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7154f46a", + "id": "11", "metadata": { "lines_to_next_cell": 2 }, @@ -205,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd892419", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2637cb51", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +227,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d2b93380", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -237,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17a63859", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd412631", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -257,7 +257,7 @@ }, { "cell_type": "markdown", - "id": "ae02c9d8", + "id": "17", "metadata": {}, "source": [ "### Coupler model\n", @@ -268,7 +268,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e3ef4db", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -279,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a893dd3", + "id": "19", "metadata": { "lines_to_next_cell": 2 }, @@ -302,7 +302,7 @@ }, { "cell_type": "markdown", - "id": "30028ba5", + "id": "20", "metadata": {}, "source": [ "For a 200nm gap the effective index difference `dn` is `0.026`, which means that there is 100% power coupling over 29.4" @@ -310,7 +310,7 @@ }, { "cell_type": "markdown", - "id": "befd3544", + "id": "21", "metadata": {}, "source": [ "If we ignore the coupling from the bend `coupling0 = 0` we know that for a 3dB coupling we need half of the `lc` length, which is the length needed to coupler `100%` of power." @@ -319,7 +319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4d98669c", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -329,7 +329,7 @@ }, { "cell_type": "markdown", - "id": "6ce5de4e", + "id": "23", "metadata": {}, "source": [ "## SAX gdsfactory Compatibility\n", @@ -341,7 +341,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ccc6900", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -352,7 +352,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6173c48e", + "id": "25", "metadata": { "lines_to_next_cell": 2 }, @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "f350989b", + "id": "26", "metadata": { "lines_to_next_cell": 2 }, @@ -381,7 +381,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4dda9a8", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -414,7 +414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55460623", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -424,7 +424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e22abd5", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -444,7 +444,7 @@ { "cell_type": "code", "execution_count": null, - "id": "89e8ed0c", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -455,7 +455,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c617f3df", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -475,7 +475,7 @@ }, { "cell_type": "markdown", - "id": "fe3a989f", + "id": "32", "metadata": {}, "source": [ "## Heater model\n", @@ -486,7 +486,7 @@ { "cell_type": "code", "execution_count": null, - "id": "520e4967", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -498,7 +498,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fa74215", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -563,7 +563,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd264a37", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -577,7 +577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7dc353fc", + "id": "36", "metadata": {}, "outputs": [], "source": [ @@ -595,7 +595,7 @@ }, { "cell_type": "markdown", - "id": "96b578f9", + "id": "37", "metadata": {}, "source": [ "Now you can tune the phase shift applied to one of the arms.\n", @@ -608,7 +608,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af851a66", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -617,7 +617,7 @@ }, { "cell_type": "markdown", - "id": "daf10d1d", + "id": "39", "metadata": {}, "source": [ "As you can see the top phase shifter instance `sxt` is hard to see on the netlist.\n", @@ -627,7 +627,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0601625c", + "id": "40", "metadata": {}, "outputs": [], "source": [ @@ -638,7 +638,7 @@ }, { "cell_type": "markdown", - "id": "1cc500be", + "id": "41", "metadata": {}, "source": [ "The best way to get a deterministic name of the `instance` is naming the reference on your Pcell." @@ -647,7 +647,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42a87509", + "id": "42", "metadata": {}, "outputs": [], "source": [ @@ -671,7 +671,7 @@ }, { "cell_type": "markdown", - "id": "60e9c50d", + "id": "43", "metadata": { "lines_to_next_cell": 2 }, @@ -688,7 +688,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0e48c3ec", + "id": "44", "metadata": {}, "outputs": [], "source": [ @@ -705,7 +705,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e0169c8f", + "id": "45", "metadata": {}, "outputs": [], "source": [ @@ -731,7 +731,7 @@ }, { "cell_type": "markdown", - "id": "f79bee28", + "id": "46", "metadata": {}, "source": [ "## Coupler sim\n", @@ -742,7 +742,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fc89f62", + "id": "47", "metadata": {}, "outputs": [], "source": [ @@ -753,7 +753,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a45a31ca", + "id": "48", "metadata": { "lines_to_next_cell": 2 }, @@ -765,7 +765,7 @@ }, { "cell_type": "markdown", - "id": "7212f716", + "id": "49", "metadata": { "lines_to_next_cell": 2 }, @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13eac70b", + "id": "50", "metadata": {}, "outputs": [], "source": [ @@ -796,7 +796,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f626de69", + "id": "51", "metadata": {}, "outputs": [], "source": [ @@ -825,7 +825,7 @@ }, { "cell_type": "markdown", - "id": "1fcef73c", + "id": "52", "metadata": {}, "source": [ "As you can see two couplers have more broadband response" @@ -833,7 +833,7 @@ }, { "cell_type": "markdown", - "id": "90389668", + "id": "53", "metadata": {}, "source": [] } diff --git a/docs/notebooks/31_data_analysis_mzi.ipynb b/docs/notebooks/31_data_analysis_mzi.ipynb index 6f82302f..f212fe52 100644 --- a/docs/notebooks/31_data_analysis_mzi.ipynb +++ b/docs/notebooks/31_data_analysis_mzi.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "5d49b28c", + "id": "0", "metadata": {}, "source": [ "# Data analysis MZI\n", @@ -60,7 +60,7 @@ { "cell_type": "code", "execution_count": null, - "id": "72d79144", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20a3e15b", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "3eeaae4c", + "id": "3", "metadata": {}, "source": [ "For some reason this MZI has an interference pattern. This is strange because the lengths of both arms are the same. This means that there was a strong height variation on the chip." @@ -93,7 +93,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25062381", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -104,7 +104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a87a2ff", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7075e4b1", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +128,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4abed017", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -140,7 +140,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a50bd499", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -150,7 +150,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d7f5ac8", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4abb9b1", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "688e7d87", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2242f456", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -219,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "347052a1", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e79030b", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d121403", + "id": "15", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/notebooks/32_data_analysis_ring.ipynb b/docs/notebooks/32_data_analysis_ring.ipynb index 30e9a4b2..72350eed 100644 --- a/docs/notebooks/32_data_analysis_ring.ipynb +++ b/docs/notebooks/32_data_analysis_ring.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c3b33867", + "id": "0", "metadata": {}, "source": [ "# Data analysis ring\n", @@ -27,7 +27,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53a4d143", + "id": "1", "metadata": { "attributes": { "classes": [], @@ -45,7 +45,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f3c643f", + "id": "2", "metadata": { "attributes": { "classes": [], diff --git a/docs/notebooks/33_data_analysis_dbr.ipynb b/docs/notebooks/33_data_analysis_dbr.ipynb index b453ecb0..d799a9f5 100644 --- a/docs/notebooks/33_data_analysis_dbr.ipynb +++ b/docs/notebooks/33_data_analysis_dbr.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "bd09fcec", + "id": "0", "metadata": {}, "source": [ "# Data analysis DBR\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20194c4f", + "id": "1", "metadata": { "attributes": { "classes": [], @@ -33,7 +33,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1406f8cd", + "id": "2", "metadata": { "attributes": { "classes": [], @@ -51,7 +51,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b3c9ec26", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12715ac7", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93a5a537", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e4aa90a5", + "id": "6", "metadata": {}, "outputs": [], "source": [ diff --git a/install_tech.py b/install_tech.py index 658cb5dc..da740b39 100644 --- a/install_tech.py +++ b/install_tech.py @@ -1,4 +1,5 @@ """Symlink tech to klayout.""" + import os import pathlib import shutil diff --git a/pyproject.toml b/pyproject.toml index 706001f7..3943af0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,9 @@ docs = [ "jupyter-book==0.15.1" ] +[tool.codespell] +ignore-words-list = "te, te/tm, te, ba, fpr, fpr_spacing, ro, nd, donot, schem" + [tool.mypy] python_version = "3.10" strict = true diff --git a/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.yml b/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.yml deleted file mode 100644 index 56d99879..00000000 --- a/sparameters/straight_length3_d34ef86b690da3f9c50cb80b5cf3ff11.yml +++ /dev/null @@ -1,368 +0,0 @@ -component: - name: straight_length3 - ports: - o1: - center: - - 0.0 - - 0.0 - layer: - - 1 - - 0 - name: o1 - orientation: 180.0 - port_type: optical - shear_angle: null - width: 0.5 - o2: - center: - - 3.0 - - 0.0 - layer: - - 1 - - 0 - name: o2 - orientation: 0.0 - port_type: optical - shear_angle: null - width: 0.5 - settings: - changed: - length: 3 - child: null - default: - cross_section: strip - length: 10.0 - npoints: 2 - with_bbox: true - full: - cross_section: strip - length: 3 - npoints: 2 - with_bbox: true - function_name: straight - info: - cross_section: strip - function_name: cross_section - length: 3.0 - route_info: - length: 3.0 - type: - auto_widen: false - auto_widen_minimum_length: 200.0 - bbox_layers: [] - bbox_offsets: [] - cladding_layers: - - DEVREC - cladding_offsets: - - 0.0 - cladding_simplify: null - end_straight_length: 0.01 - gap: 3.0 - info: - function_name: cross_section - settings: - add_bbox: null - add_pins: - function: add_pins_siepic - auto_widen: false - auto_widen_minimum_length: 200.0 - bbox_layers: null - bbox_offsets: null - cladding_layers: - - DEVREC - cladding_offsets: - - 0 - cladding_simplify: null - decorator: null - end_straight_length: 0.01 - gap: 3.0 - info: null - layer: WG - min_length: 0.01 - mirror: false - name: null - offset: 0 - port_names: - - o1 - - o2 - port_types: - - optical - - optical - radius: 10.0 - sections: null - snap_to_grid: null - start_straight_length: 0.01 - taper_length: 10.0 - width: 0.5 - width_wide: null - layer: WG - min_length: 0.01 - mirror: false - name: null - offset: 0.0 - port_names: - - o1 - - o2 - port_types: - - optical - - optical - radius: 10.0 - sections: [] - simplify: null - snap_to_grid: null - start_straight_length: 0.01 - taper_length: 10.0 - width: 0.5 - width_wide: null - weight: 3.0 - ? '{''layer'': ''WG'', ''width'': 0.5, ''offset'': 0.0, ''radius'': 10.0, - ''width_wide'': None, ''simplify'': None, ''auto_widen'': False, ''auto_widen_minimum_length'': - 200.0, ''taper_length'': 10.0, ''bbox_layers'': [], ''bbox_offsets'': [], - ''cladding_layers'': [''DEVREC''], ''cladding_offsets'': [0.0], ''cladding_simplify'': - None, ''sections'': [], ''port_names'': [''o1'', ''o2''], ''port_types'': - [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': 0.01, ''start_straight_length'': - 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': None, ''info'': {''settings'': - {''width'': 0.5, ''offset'': 0, ''layer'': ''WG'', ''width_wide'': None, - ''auto_widen'': False, ''auto_widen_minimum_length'': 200.0, ''taper_length'': - 10.0, ''radius'': 10.0, ''sections'': None, ''port_names'': [''o1'', ''o2''], - ''port_types'': [''optical'', ''optical''], ''gap'': 3.0, ''min_length'': - 0.01, ''start_straight_length'': 0.01, ''end_straight_length'': 0.01, ''snap_to_grid'': - None, ''bbox_layers'': None, ''bbox_offsets'': None, ''cladding_layers'': - [''DEVREC''], ''cladding_offsets'': [0], ''cladding_simplify'': None, ''info'': - None, ''decorator'': None, ''add_pins'': {''function'': ''add_pins_siepic''}, - ''add_bbox'': None, ''mirror'': False, ''name'': None}, ''function_name'': - ''cross_section''}, ''name'': None, ''mirror'': False}_length' - : 3.0 - settings: - add_bbox: null - add_pins: - function: add_pins_siepic - auto_widen: false - auto_widen_minimum_length: 200.0 - bbox_layers: null - bbox_offsets: null - cladding_layers: - - DEVREC - cladding_offsets: - - 0 - cladding_simplify: null - decorator: null - end_straight_length: 0.01 - gap: 3.0 - info: null - layer: WG - min_length: 0.01 - mirror: false - name: null - offset: 0 - port_names: - - o1 - - o2 - port_types: - - optical - - optical - radius: 10.0 - sections: null - snap_to_grid: null - start_straight_length: 0.01 - taper_length: 10.0 - width: 0.5 - width_wide: null - width: 0.5 - info_version: 2 - module: gdsfactory.components.straight - name: straight_length3 -compute_time_minutes: 0.1275598446528117 -compute_time_seconds: 7.653590679168701 -dispersive: false -is_3d: false -layer_stack: - box: - background_doping_concentration: null - background_doping_ion: null - bias: null - derived_layer: null - info: - mesh_order: 99 - into: null - layer: !!python/tuple - - 99999 - - 0 - layer_type: grow - material: sio2 - mesh_order: 3 - mode: null - orientation: '100' - resistivity: null - sidewall_angle: 0.0 - sidewall_angle_tolerance: null - thickness: 3.0 - thickness_tolerance: null - width_to_z: 0.0 - z_to_bias: null - zmin: -3.0 - zmin_tolerance: null - clad: - background_doping_concentration: null - background_doping_ion: null - bias: null - derived_layer: null - info: - mesh_order: 100 - into: null - layer: !!python/tuple - - 99999 - - 0 - layer_type: grow - material: sio2 - mesh_order: 3 - mode: null - orientation: '100' - resistivity: null - sidewall_angle: 0.0 - sidewall_angle_tolerance: null - thickness: 1.8000000000000003 - thickness_tolerance: null - width_to_z: 0.0 - z_to_bias: null - zmin: 0.0 - zmin_tolerance: null - core: - background_doping_concentration: null - background_doping_ion: null - bias: null - derived_layer: null - info: - mesh_order: 1 - into: null - layer: !!python/tuple - - 1 - - 0 - layer_type: grow - material: si - mesh_order: 3 - mode: null - orientation: '100' - resistivity: null - sidewall_angle: 10.0 - sidewall_angle_tolerance: null - thickness: 0.22 - thickness_tolerance: null - width_to_z: 0.5 - z_to_bias: null - zmin: 0.0 - zmin_tolerance: null - core2: - background_doping_concentration: null - background_doping_ion: null - bias: null - derived_layer: null - info: - mesh_order: 1 - into: null - layer: !!python/tuple - - 31 - - 0 - layer_type: grow - material: si - mesh_order: 3 - mode: null - orientation: '100' - resistivity: null - sidewall_angle: 10.0 - sidewall_angle_tolerance: null - thickness: 0.22 - thickness_tolerance: null - width_to_z: 0.5 - z_to_bias: null - zmin: 0.0 - zmin_tolerance: null - heater: - background_doping_concentration: null - background_doping_ion: null - bias: null - derived_layer: null - info: - mesh_order: 1 - into: null - layer: !!python/tuple - - 11 - - 0 - layer_type: grow - material: TiN - mesh_order: 3 - mode: null - orientation: '100' - resistivity: null - sidewall_angle: 0.0 - sidewall_angle_tolerance: null - thickness: 0.75 - thickness_tolerance: null - width_to_z: 0.0 - z_to_bias: null - zmin: 1.1 - zmin_tolerance: null - metal2: - background_doping_concentration: null - background_doping_ion: null - bias: null - derived_layer: null - info: - mesh_order: 2 - into: null - layer: !!python/tuple - - 12 - - 0 - layer_type: grow - material: Aluminum - mesh_order: 3 - mode: null - orientation: '100' - resistivity: null - sidewall_angle: 0.0 - sidewall_angle_tolerance: null - thickness: 0.7000000000000001 - thickness_tolerance: null - width_to_z: 0.0 - z_to_bias: null - zmin: 1.8000000000000003 - zmin_tolerance: null - substrate: - background_doping_concentration: null - background_doping_ion: null - bias: null - derived_layer: null - info: - mesh_order: 99 - into: null - layer: !!python/tuple - - 99999 - - 0 - layer_type: grow - material: si - mesh_order: 3 - mode: null - orientation: '100' - resistivity: null - sidewall_angle: 0.0 - sidewall_angle_tolerance: null - thickness: 10.0 - thickness_tolerance: null - width_to_z: 0.0 - z_to_bias: null - zmin: -13.0 - zmin_tolerance: null -port_margin: 2 -port_monitor_offset: -0.1 -port_source_offset: -0.1 -port_symmetries: - o2@0,o1@0: - - o1@0,o2@0 -resolution: 30 -wavelength_points: 50 -wavelength_start: 1.5 -wavelength_stop: 1.6 -xmargin_left: 0 -xmargin_right: 0 -ymargin_bot: 3 -ymargin_top: 3 diff --git a/ubcpdk/components.py b/ubcpdk/components.py index 9be61608..9e684f28 100644 --- a/ubcpdk/components.py +++ b/ubcpdk/components.py @@ -1,4 +1,5 @@ """Cells imported from the PDK.""" + from functools import cache, partial import gdsfactory as gf diff --git a/ubcpdk/data/__init__.py b/ubcpdk/data/__init__.py index c7b8dc35..d863252b 100644 --- a/ubcpdk/data/__init__.py +++ b/ubcpdk/data/__init__.py @@ -1,6 +1,5 @@ """Data analysis module.""" - from .chop import chop from .find_bandwidth import find_bandwidth from .read_mat import read_mat diff --git a/ubcpdk/samples/data/mzi/IPC_LukasChrostowski.rtf b/ubcpdk/samples/data/mzi/IPC_LukasChrostowski.rtf deleted file mode 100755 index 1b99fb0f..00000000 --- a/ubcpdk/samples/data/mzi/IPC_LukasChrostowski.rtf +++ /dev/null @@ -1,34 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\margl1440\margr1440\vieww12600\viewh10200\viewkind0 -\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural - -\f0\fs28 \cf0 Measuring optical waveguide length:\ -- measure the horizontal path, from centre to centre (path is the one with sharp angles)\ -- add 2 * ybranch output separation\ -\ -Can also measure the waveguide by finding the total area\ -{\field{\*\fldinst{HYPERLINK "http://www.klayout.de/useful_scripts.html#calc_area.rbm"}}{\fldrslt http://www.klayout.de/useful_scripts.html#calc_area.rbm}}\ -then divide by the waveguide width\ -\ -MZI1:\ -dL_wg=(85.10000-77.20000)*2 +5.5*2; dL_wg\ -= 26.8\ -\ -or, \ -area1 = 80.210502\ -area2 = 66.810502\ -dL_wg = (80.210502-66.810502)/0.5; dL_wg\ -= 26.8\ -\ -MZI2:\ -dL_wg=(768.95000-77.20000)*2 +5.5*2; dL_wg\ -= 1394.5\ -\ -\ -\ -\ -\ -\ -} diff --git a/ubcpdk/samples/data/mzi/IPC_ZiheGao.rtf b/ubcpdk/samples/data/mzi/README.md similarity index 60% rename from ubcpdk/samples/data/mzi/IPC_ZiheGao.rtf rename to ubcpdk/samples/data/mzi/README.md index 8dfb5843..85071740 100755 --- a/ubcpdk/samples/data/mzi/IPC_ZiheGao.rtf +++ b/ubcpdk/samples/data/mzi/README.md @@ -1,14 +1,8 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\margl1440\margr1440\vieww12600\viewh10200\viewkind0 -\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural - -\f0\fs28 \cf0 Measuring optical waveguide length:\ +Measuring optical waveguide length: - measure the vertical path, from centre to centre (path is the one with sharp angles)\ - determine radius (from PCell)\ - add the radial bend waveguide, subtract the path in that same place\ -\ +- MZI1:\ dL_wg=0\ \ @@ -54,9 +48,28 @@ MZI17:\ r=2\ dL_path = (259.55000-148.15000) * 2\ dL_wg = dL_path + 2*pi*r - 4*2*r ; dL_wg\ -= 219.366\ + + +## Lukas + +Measuring optical waveguide length:\ +- measure the horizontal path, from centre to centre (path is the one with sharp angles)\ +- add 2 * ybranch output separation\ \ +Can also measure the waveguide by finding the total area\ +{\field{\*\fldinst{HYPERLINK "http://www.klayout.de/useful_scripts.html#calc_area.rbm"}}{\fldrslt http://www.klayout.de/useful_scripts.html#calc_area.rbm}}\ +then divide by the waveguide width\ \ +MZI1:\ +dL_wg=(85.10000-77.20000)*2 +5.5*2; dL_wg\ += 26.8\ \ +or, \ +area1 = 80.210502\ +area2 = 66.810502\ +dL_wg = (80.210502-66.810502)/0.5; dL_wg\ += 26.8\ \ -} +MZI2:\ +dL_wg=(768.95000-77.20000)*2 +5.5*2; dL_wg\ += 1394.5\ diff --git a/ubcpdk/tech.py b/ubcpdk/tech.py index c41150f0..2e780e19 100644 --- a/ubcpdk/tech.py +++ b/ubcpdk/tech.py @@ -4,6 +4,7 @@ - cross_sections (xs_) - constants (WIDTH, CLADDING_OFFSET ...) """ + import sys from functools import partial