diff --git a/gplugins/fdtdz/get_ports_fdtdz.py b/gplugins/fdtdz/get_ports_fdtdz.py index f2c4ad91..0f99c18e 100644 --- a/gplugins/fdtdz/get_ports_fdtdz.py +++ b/gplugins/fdtdz/get_ports_fdtdz.py @@ -228,7 +228,7 @@ def plot_mode( port=c.ports["o1"], epsilon=epsilon, xmin=c.dxmin, - ymin=c.ymin, + ymin=c.dymin, nm_per_pixel=nm_per_pixel, port_extent_xy=1, ) @@ -238,7 +238,7 @@ def plot_mode( epsilon_port=epsilon_port, excitation=excitation, xmin=c.dxmin, - ymin=c.ymin, + ymin=c.dymin, zmin=zmin, nm_per_pixel=1000, figsize=(11, 4), diff --git a/gplugins/fdtdz/get_sparameters_fdtdz.py b/gplugins/fdtdz/get_sparameters_fdtdz.py index 5bf81143..eabf7bbc 100644 --- a/gplugins/fdtdz/get_sparameters_fdtdz.py +++ b/gplugins/fdtdz/get_sparameters_fdtdz.py @@ -131,7 +131,7 @@ def get_sparameters_fdtdz( port=component.ports[portname], epsilon=epsilon, xmin=component_extended.dxmin, - ymin=component_extended.ymin, + ymin=component_extended.dymin, nm_per_pixel=nm_per_pixel, port_extent_xy=port_margin, ) diff --git a/gplugins/gmeep/get_simulation.py b/gplugins/gmeep/get_simulation.py index 998c9192..f10833f3 100644 --- a/gplugins/gmeep/get_simulation.py +++ b/gplugins/gmeep/get_simulation.py @@ -193,8 +193,8 @@ def get_simulation( cell_thickness = tpml + zmargin_bot + t_core + zmargin_top + tpml if is_3d else 0 cell_size = mp.Vector3( - component.xsize + 2 * tpml, - component.ysize + 2 * tpml, + component.dxsize + 2 * tpml, + component.dysize + 2 * tpml, cell_thickness, ) diff --git a/gplugins/gmeep/meep_adjoint_optimization.py b/gplugins/gmeep/meep_adjoint_optimization.py index 9e581f54..61203873 100644 --- a/gplugins/gmeep/meep_adjoint_optimization.py +++ b/gplugins/gmeep/meep_adjoint_optimization.py @@ -151,8 +151,8 @@ def get_meep_adjoint_optimizer( Vector3(*cell_size) if cell_size else Vector3( - c.xsize + 2 * sim.boundary_layers[0].thickness, - c.ysize + 2 * sim.boundary_layers[0].thickness, + c.dxsize + 2 * sim.boundary_layers[0].thickness, + c.dysize + 2 * sim.boundary_layers[0].thickness, cell_thickness, ) ) diff --git a/gplugins/gmsh/xyz_mesh.py b/gplugins/gmsh/xyz_mesh.py index 3d57e036..4f697010 100644 --- a/gplugins/gmsh/xyz_mesh.py +++ b/gplugins/gmsh/xyz_mesh.py @@ -197,7 +197,7 @@ def xyz_mesh( background_remeshing_file: .pos file to use as a remeshing field. Overrides resolutions if not None. """ if port_names: - mesh_component = component.copy() + mesh_component = component.dup() mesh_component.add_ports(component.ports) component = get_component_with_net_layers( component=mesh_component, diff --git a/gplugins/klayout/get_density.py b/gplugins/klayout/get_density.py index c32cbe28..18ab6774 100644 --- a/gplugins/klayout/get_density.py +++ b/gplugins/klayout/get_density.py @@ -386,8 +386,8 @@ def component_test_density1(): small_rect.dx += 10 small_rect.dy += 10 small_rect2 = c << gf.components.rectangle(size=(25, 25), layer=(2, 0)) - small_rect2.dymax = 100 - small_rect2.ysize - small_rect2.dxmax = large_rect.dxmax - small_rect2.xsize + small_rect2.dymax = 100 - small_rect2.dysize + small_rect2.dxmax = large_rect.dxmax - small_rect2.dxsize # c.write_gds(PATH.test_data / "test_gds_density1.gds") return c diff --git a/gplugins/klayout/tests/test_density.py b/gplugins/klayout/tests/test_density.py index 574556ad..65232144 100644 --- a/gplugins/klayout/tests/test_density.py +++ b/gplugins/klayout/tests/test_density.py @@ -18,8 +18,8 @@ def component_test_density1(): large_rect = c << gf.components.rectangle(size=(100, 150), layer=(1, 0)) _small_rect = c << gf.components.rectangle(size=(50, 50), layer=(2, 0)) small_rect2 = c << gf.components.rectangle(size=(25, 25), layer=(2, 0)) - small_rect2.dymax = 100 - small_rect2.ysize - small_rect2.dxmax = large_rect.dxmax - small_rect2.xsize + small_rect2.dymax = 100 - small_rect2.dysize + small_rect2.dxmax = large_rect.dxmax - small_rect2.dxsize return c diff --git a/gplugins/lumerical/write_sparameters_lumerical.py b/gplugins/lumerical/write_sparameters_lumerical.py index 540f7bf2..b3ba54b4 100644 --- a/gplugins/lumerical/write_sparameters_lumerical.py +++ b/gplugins/lumerical/write_sparameters_lumerical.py @@ -265,7 +265,7 @@ def write_sparameters_lumerical( logger.info(f"Writing Sparameters to {filepath_npz.absolute()!r}") x_min = (component_extended.dxmin - xmargin) * 1e-6 x_max = (component_extended.dxmax + xmargin) * 1e-6 - y_min = (component_extended.ymin - ymargin) * 1e-6 + y_min = (component_extended.dymin - ymargin) * 1e-6 y_max = (component_extended.dymax + ymargin) * 1e-6 layers_thickness = [ diff --git a/gplugins/sentaurus/sde.py b/gplugins/sentaurus/sde.py index d5cd50f9..3dfa2215 100644 --- a/gplugins/sentaurus/sde.py +++ b/gplugins/sentaurus/sde.py @@ -71,7 +71,7 @@ def initialize_sde( else: xmin = component.dxmin xmax = component.dxmax - ymin = component.ymin + ymin = component.dymin ymax = component.dymax # Initialize @@ -287,8 +287,8 @@ def write_sde( component=test_straight, domain=[[0, -4], [0, 4], [length, 4], [length, -4]] ) - yp = (test_component.dymax + test_component.ymin) / 2 + test_component.ysize / 2 - ym = (test_component.dymax + test_component.ymin) / 2 - test_component.ysize / 2 + yp = (test_component.dymax + test_component.dymin) / 2 + test_component.dysize / 2 + ym = (test_component.dymax + test_component.dymin) / 2 - test_component.dysize / 2 WAFER_STACK.layers["substrate"].material = "Silicon" WAFER_STACK.layers["substrate"].thickness = 1 diff --git a/gplugins/sentaurus/sprocess.py b/gplugins/sentaurus/sprocess.py index e04cff3a..b0de64cd 100644 --- a/gplugins/sentaurus/sprocess.py +++ b/gplugins/sentaurus/sprocess.py @@ -98,7 +98,7 @@ def initialize_sprocess( else: xmin = component.dxmin xmax = component.dxmax - ymin = component.ymin + ymin = component.dymin ymax = component.dymax # Initial z-mesh from waferstack and resolutions @@ -587,19 +587,19 @@ def cut_tdr( component=test_straight, domain=[[0, -4], [0, 4], [length, 4], [length, -4]] ) - yp = (test_component.dymax + test_component.ymin) / 2 + test_component.ysize / 2 - ym = (test_component.dymax + test_component.ymin) / 2 - test_component.ysize / 2 + yp = (test_component.dymax + test_component.dymin) / 2 + test_component.dysize / 2 + ym = (test_component.dymax + test_component.dymin) / 2 - test_component.dysize / 2 c.add_port( name="e1", center=(length / 2, yp), - width=test_component.ysize / 2, + width=test_component.dysize / 2, orientation=0, layer=LAYER.VIAC, ) c.add_port( name="e2", center=(length / 2, ym), - width=test_component.ysize / 2, + width=test_component.dysize / 2, orientation=0, layer=LAYER.VIAC, ) @@ -624,8 +624,8 @@ def cut_tdr( ) contact_str = f"""contact name=cathode aluminum silicon xlo=0.0 xhi=0.2 ylo=0.0 yhi=1 zlo=0 zhi=0 -contact name=anode aluminum silicon xlo=0.0 xhi=0.2 ylo={c.ysize-1:1.3f} yhi={c.ysize:1.3f} zlo=0 zhi=0 -contact name=substrate box silicon xlo=4.2 xhi=4.3 ylo=0.0 yhi={c.ysize:1.3f} zlo=0 zhi=0 +contact name=anode aluminum silicon xlo=0.0 xhi=0.2 ylo={c.dysize-1:1.3f} yhi={c.dysize:1.3f} zlo=0 zhi=0 +contact name=substrate box silicon xlo=4.2 xhi=4.3 ylo=0.0 yhi={c.dysize:1.3f} zlo=0 zhi=0 """ write_sprocess( @@ -634,7 +634,7 @@ def cut_tdr( layermap=LAYER, process=get_process(), xsection_bounds=( - ((test_component.dxmin + test_component.dxmax) / 2, test_component.ymin), + ((test_component.dxmin + test_component.dxmax) / 2, test_component.dymin), ((test_component.dxmin + test_component.dxmax) / 2, test_component.dymax), ), save_directory="./sprocess/", diff --git a/notebooks/fdtdz_01.ipynb b/notebooks/fdtdz_01.ipynb index 1b7bc73e..fc18a937 100644 --- a/notebooks/fdtdz_01.ipynb +++ b/notebooks/fdtdz_01.ipynb @@ -226,7 +226,7 @@ " y=None,\n", " z=-0.1,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -238,7 +238,7 @@ " y=None,\n", " z=0.05,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -250,7 +250,7 @@ " y=None,\n", " z=0.11,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -262,7 +262,7 @@ " y=None,\n", " z=0.5,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -274,7 +274,7 @@ " y=None,\n", " z=0.75,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -302,7 +302,7 @@ " y=None,\n", " z=None,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -314,7 +314,7 @@ " y=None,\n", " z=None,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -326,7 +326,7 @@ " y=-5,\n", " z=None,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -338,7 +338,7 @@ " y=-3,\n", " z=None,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -350,7 +350,7 @@ " y=-1.5,\n", " z=None,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -362,7 +362,7 @@ " y=0,\n", " z=None,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(11, 4),\n", @@ -395,7 +395,7 @@ " port=c.ports[\"o1\"],\n", " epsilon=epsilon,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " nm_per_pixel=nm_per_pixel,\n", " port_extent_xy=1,\n", ")\n", @@ -405,7 +405,7 @@ " epsilon_port=epsilon_port,\n", " excitation=excitation,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(20, 6),\n", @@ -416,7 +416,7 @@ " port=c.ports[\"o2\"],\n", " epsilon=epsilon,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " nm_per_pixel=nm_per_pixel,\n", " port_extent_xy=1,\n", ")\n", @@ -426,7 +426,7 @@ " epsilon_port=epsilon_port,\n", " excitation=excitation,\n", " xmin=c.dxmin,\n", - " ymin=c.ymin,\n", + " ymin=c.dymin,\n", " zmin=zmin,\n", " nm_per_pixel=nm_per_pixel,\n", " figsize=(20, 6),\n", diff --git a/notebooks/palace_01_electrostatic.ipynb b/notebooks/palace_01_electrostatic.ipynb index 3a047428..3f637e8f 100644 --- a/notebooks/palace_01_electrostatic.ipynb +++ b/notebooks/palace_01_electrostatic.ipynb @@ -40,8 +40,8 @@ "\n", "import gdsfactory as gf\n", "import pyvista as pv\n", - "from gdsfactory.components.interdigital_capacitor_enclosed import (\n", - " interdigital_capacitor_enclosed,\n", + "from gdsfactory.components.interdigital_capacitor import (\n", + " interdigital_capacitor,\n", ")\n", "from gdsfactory.generic_tech import LAYER, get_generic_pdk\n", "from gdsfactory.technology import LayerStack\n", @@ -104,12 +104,10 @@ "outputs": [], "source": [ "simulation_box = [[-200, -200], [200, 200]]\n", - "c = gf.Component(\"capacitance_palace\")\n", - "cap = c << interdigital_capacitor_enclosed(\n", - " metal_layer=LAYER.WG, gap_layer=LAYER.DEEPTRENCH, enclosure_box=simulation_box\n", - ")\n", + "c = gf.Component()\n", + "cap = c << interdigital_capacitor()\n", "c.add_ports(cap.ports)\n", - "substrate = gf.components.bbox(bbox=simulation_box, layer=LAYER.WAFER)\n", + "substrate = gf.components.bbox(c, layer=LAYER.WAFER)\n", "c << substrate\n", "c.plot()" ] @@ -241,6 +239,18 @@ "display_name": "base", "language": "python", "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" } }, "nbformat": 4, diff --git a/notebooks/palace_02_fullwave.ipynb b/notebooks/palace_02_fullwave.ipynb index b93fca28..75618a97 100644 --- a/notebooks/palace_02_fullwave.ipynb +++ b/notebooks/palace_02_fullwave.ipynb @@ -53,9 +53,7 @@ "import numpy as np\n", "import pyvista as pv\n", "import skrf\n", - "from gdsfactory.components.interdigital_capacitor_enclosed import (\n", - " interdigital_capacitor_enclosed,\n", - ")\n", + "from gdsfactory.components.interdigital_capacitor import interdigital_capacitor\n", "from gdsfactory.generic_tech import LAYER, get_generic_pdk\n", "from gdsfactory.technology import LayerStack\n", "from gdsfactory.technology.layer_stack import LayerLevel\n", @@ -124,12 +122,9 @@ "metadata": {}, "outputs": [], "source": [ - "simulation_box = [[-200, -200], [200, 200]]\n", - "c = gf.Component(\"scattering_palace\")\n", - "cap = c << interdigital_capacitor_enclosed(\n", - " metal_layer=LAYER.WG, gap_layer=LAYER.DEEPTRENCH, enclosure_box=simulation_box\n", - ")\n", - "c.show()" + "c = gf.Component()\n", + "cap = c << interdigital_capacitor()\n", + "c" ] }, { @@ -139,24 +134,22 @@ "metadata": {}, "outputs": [], "source": [ + "c = gf.Component()\n", + "cap = c << interdigital_capacitor()\n", + "\n", "# Add lumped port rectangles manually, see examples for https://awslabs.github.io/palace/stable/examples/cpw/\n", - "lumped_port_1_1 = gf.components.bbox(((-40, 11), (-46, 5)), layer=LAYER.PORT)\n", - "lumped_port_1_2 = gf.components.bbox(((-40, -11), (-46, -5)), layer=LAYER.PORT)\n", - "c << lumped_port_1_1\n", - "c << lumped_port_1_2\n", - "c.add_port(\"o1_1\", lumped_port_1_1.center, layer=LAYER.PORT, width=1)\n", - "c.add_port(\"o1_2\", lumped_port_1_2.center, layer=LAYER.PORT, width=1)\n", + "c.add_polygon([(-40, +11), (-46, +11), (-46, +5), (-40, +5)], layer=LAYER.PORT)\n", + "c.add_polygon([(40, -11), (46, -11), (46, -5), (40, -5)], layer=LAYER.WAFER)\n", "\n", - "lumped_port_2_1 = gf.components.bbox(((40, 11), (46, 5)), layer=LAYER.PORT)\n", - "lumped_port_2_2 = gf.components.bbox(((40, -11), (46, -5)), layer=LAYER.PORT)\n", - "c << lumped_port_2_1\n", - "c << lumped_port_2_2\n", - "c.add_port(\"o2_1\", lumped_port_2_1.center, layer=LAYER.PORT, width=1)\n", - "c.add_port(\"o2_2\", lumped_port_2_2.center, layer=LAYER.PORT, width=1)\n", + "c.add_port(\n", + " \"o1_1\", center=(-40, (11 + 5) / 2), layer=LAYER.PORT, width=1, orientation=180\n", + ")\n", + "c.add_port(\"o1_2\", center=(+46, -11), layer=LAYER.PORT, width=1, orientation=0)\n", "\n", - "substrate = gf.components.bbox(bbox=simulation_box, layer=LAYER.WAFER)\n", - "c << substrate\n", - "c.show()" + "c.add_polygon([(-200, -200), (200, -200), (200, 200), (-200, 200)], layer=LAYER.WAFER)\n", + "c.draw_ports()\n", + "c.show()\n", + "c" ] }, { diff --git a/notebooks/workflow_2_ring.ipynb b/notebooks/workflow_2_ring.ipynb index 210062e6..21838f5d 100644 --- a/notebooks/workflow_2_ring.ipynb +++ b/notebooks/workflow_2_ring.ipynb @@ -249,7 +249,7 @@ " function=gf.routing.add_fiber_single,\n", " )\n", " m.dxmin = r.dxmax + 10\n", - " m.ymin = r.ymin\n", + " m.dymin = r.dymin\n", " _ = c << gf.components.seal_ring(c.bbox)\n", " return c\n", "\n", @@ -292,7 +292,7 @@ " r = c << rings\n", " m = c << gf.pack(rings_with_pads)[0]\n", " m.dxmin = r.dxmax + 10\n", - " m.ymin = r.ymin\n", + " m.dymin = r.dymin\n", " _ = c << gf.components.seal_ring(c.bbox)\n", " return c\n", "\n",