Skip to content

Commit

Permalink
Merge pull request #472 from gdsfactory/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
joamatab authored Aug 26, 2024
2 parents f290b98 + c80df21 commit e4e0aa6
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.7"
rev: "v0.6.1"
hooks:
- id: ruff
- id: ruff-format
Expand Down
1 change: 0 additions & 1 deletion notebooks/21_schematic_driven_layout_lumerical.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"from gplugins.spice.spice_to_yaml import spice_to_yaml\n",
"from gplugins.spice.tests.test_interconnect import spice_netlist_interconnect\n",
"\n",
"\n",
"netlist_path = GDSDIR_TEMP / \"test_interconnect.sp\"\n",
"netlist_path.write_text(spice_netlist_interconnect)\n",
"picyaml_path = GDSDIR_TEMP / \"test_interconnect.sp\"\n",
Expand Down
3 changes: 0 additions & 3 deletions notebooks/elmer_01_electrostatic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
},
"outputs": [],
"source": [
"import os\n",
"from math import inf\n",
"from pathlib import Path\n",
"\n",
"import gdsfactory as gf\n",
"import pyvista as pv\n",
Expand All @@ -49,7 +47,6 @@
"from gdsfactory.generic_tech import LAYER, get_generic_pdk\n",
"from gdsfactory.technology import LayerStack\n",
"from gdsfactory.technology.layer_stack import LayerLevel\n",
"from IPython.display import display\n",
"\n",
"from gplugins.elmer import run_capacitive_simulation_elmer\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/fdtdz_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"c = gf.Component()\n",
"waveguide_rib = c << gf.components.straight(length=length, cross_section=rib)\n",
"nitride_feature = c << gf.components.circle(radius=2, layer=LAYER.WGN)\n",
"nitride_feature.dx= 5\n",
"nitride_feature.dx = 5\n",
"padding = c << gf.components.bbox(\n",
" waveguide_rib.bbox, top=2, bottom=2, layer=LAYER.WAFER\n",
")\n",
Expand Down
12 changes: 6 additions & 6 deletions notebooks/femwell_01_modes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
" }\n",
")\n",
"\n",
"filtered_layer_stack.layers[\"core\"].thickness = (\n",
" 0.22 # Perturb the layer_stack before simulating\n",
")\n",
"filtered_layer_stack.layers[\n",
" \"core\"\n",
"].thickness = 0.22 # Perturb the layer_stack before simulating\n",
"\n",
"filtered_layer_stack.layers[\"slab90\"].thickness = (\n",
" 0.09 # Perturb the layer_stack before simulating\n",
")\n",
"filtered_layer_stack.layers[\n",
" \"slab90\"\n",
"].thickness = 0.09 # Perturb the layer_stack before simulating\n",
"\n",
"resolutions = {\n",
" \"core\": {\"resolution\": 0.02, \"distance\": 1, \"SizeMax\": 0.2},\n",
Expand Down
1 change: 0 additions & 1 deletion notebooks/lumerical_1_fdtd_sparameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"c = gf.components.straight()\n",
"s = sim.write_sparameters_lumerical(c, layer_stack=layer_stack, run=False, session=s)"
]
Expand Down
8 changes: 2 additions & 6 deletions notebooks/meep_01_sparameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@
"import gdsfactory as gf\n",
"import meep as mp\n",
"\n",
"from gplugins.gmeep.get_simulation import get_simulation\n"
"from gplugins.gmeep.get_simulation import get_simulation"
]
},
{
Expand Down Expand Up @@ -1030,8 +1030,6 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"component = gf.add_padding_container(\n",
" c,\n",
" default=0,\n",
Expand Down Expand Up @@ -1060,7 +1058,7 @@
"outputs": [],
"source": [
"sim.init_sim()\n",
"sim.solve_cw(1e-6, 10000, 10)\n"
"sim.solve_cw(1e-6, 10000, 10)"
]
},
{
Expand All @@ -1084,7 +1082,6 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"import numpy as np\n",
"\n",
"eps_data = sim.get_array(vol=nonpml_vol, component=mp.Dielectric)\n",
Expand Down Expand Up @@ -1112,7 +1109,6 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"sim.run(until=400)"
]
},
Expand Down
5 changes: 3 additions & 2 deletions notebooks/path_length_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"metadata": {},
"outputs": [],
"source": [
"import gplugins.path_length_analysis.path_length_analysis_from_gds as pl\n",
"import gdsfactory as gf"
"import gdsfactory as gf\n",
"\n",
"import gplugins.path_length_analysis.path_length_analysis_from_gds as pl"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions notebooks/sax_01_sax.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"from rich.logging import RichHandler\n",
"from scipy import constants\n",
"from sklearn.linear_model import LinearRegression\n",
"from tqdm.notebook import trange, tqdm\n",
"from tqdm.notebook import tqdm, trange\n",
"\n",
"import gplugins.sax as gs\n",
"import gplugins.tidy3d as gt\n",
Expand Down Expand Up @@ -788,7 +788,7 @@
" mmi_in = gf.components.mmi1x2()\n",
" mmi_out = gf.components.mmi2x2()\n",
" bend = gf.components.bend_euler()\n",
" half_delay_straight = gf.components.straight(length=delta_length/2)\n",
" half_delay_straight = gf.components.straight(length=delta_length / 2)\n",
"\n",
" # references\n",
" mmi_in = c.add_ref(mmi_in, name=\"mmi_in\")\n",
Expand Down Expand Up @@ -1061,17 +1061,17 @@
" fn = f\"{wl=:.2f}-{n_box=:.2f}-{n_clad=:.2f}-{n_core=:.2f}-{t_slab=:.3f}-{t_soi=:.3f}-{w_core=:.3f}-{du=:.3f}-{n_modes=}.json\"\n",
" path = os.path.join(cache_path, fn)\n",
" if not replace_cached and os.path.exists(path):\n",
" return [mw.Mode.parse_obj(mode) for mode in json.load(open(path, \"r\"))]\n",
" return [mw.Mode.parse_obj(mode) for mode in json.load(open(path))]\n",
"\n",
" # fmt: off\n",
" m_core = mw.SampledMaterial(name=\"slab\", n=np.asarray([n_core, n_core]), params={\"wl\": np.asarray([1.0, 2.0])}, meta={\"color\": (0.9, 0, 0, 0.9)})\n",
" m_clad = mw.SampledMaterial(name=\"clad\", n=np.asarray([n_clad, n_clad]), params={\"wl\": np.asarray([1.0, 2.0])}) \n",
" m_clad = mw.SampledMaterial(name=\"clad\", n=np.asarray([n_clad, n_clad]), params={\"wl\": np.asarray([1.0, 2.0])})\n",
" m_box = mw.SampledMaterial(name=\"box\", n=np.asarray([n_box, n_box]), params={\"wl\": np.asarray([1.0, 2.0])})\n",
" box = mw.Structure(material=m_box, geometry=mw.Box(x_min=- 2 * w_core - delta, x_max= 2 * w_core + delta, y_min=- 2 * t_soi - delta, y_max=0.0, z_min=0.0, z_max=length))\n",
" slab = mw.Structure(material=m_core, geometry=mw.Box(x_min=-2 * w_core - delta, x_max=2 * w_core + delta, y_min=0.0, y_max=t_slab, z_min=0.0, z_max=length))\n",
" clad = mw.Structure(material=m_clad, geometry=mw.Box(x_min=-2 * w_core - delta, x_max=2 * w_core + delta, y_min=0, y_max=3 * t_soi + delta, z_min=0.0, z_max=length))\n",
" core = mw.Structure(material=m_core, geometry=mw.Box(x_min=-w_core / 2, x_max=w_core / 2, y_min=0.0, y_max=t_soi, z_min=0.0, z_max=length))\n",
" \n",
"\n",
" cell = mw.Cell(structures=[box, clad, slab, core], mesh=mw.Mesh2D( x=np.arange(-2*w_core, 2*w_core, du), y=np.arange(-2*t_soi, 3*t_soi, du), ), z_min=0.0, z_max=10.0)\n",
" cross_section = mw.CrossSection.from_cell(cell=cell, env=env)\n",
" modes = mw.compute_modes(cross_section, num_modes=n_modes)\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/tcad_02_analytical_process.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from gplugins.process.implant_tables import *\n"
"from gplugins.process.implant_tables import *"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion notebooks/workflow_1_mzi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"import gdsfactory as gf\n",
"import numpy as np\n",
"from gdsfactory.generic_tech import get_generic_pdk\n",
Expand Down
3 changes: 0 additions & 3 deletions notebooks/workflow_2_ring.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@
"metadata": {},
"outputs": [],
"source": [
"import gdsfactory as gf\n",
"import toolz\n",
"\n",
"c = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)\n",
"c.plot()"
]
Expand Down

0 comments on commit e4e0aa6

Please sign in to comment.