text
stringlengths
10
968k
id
stringlengths
14
122
metadata
dict
__index_level_0__
int64
0
242
from autosweep.data_types import filereader, metadata, recipe, station_config from autosweep.data_types.filereader import ( FileWRer, GeneralIOClass, ) from autosweep.data_types.metadata import ( PN, SN, DUTInfo, MetaNum, TimeStamp, ) from autosweep.data_types.recipe import ( Recipe, ) f...
autosweep/autosweep/data_types/__init__.py/0
{ "file_path": "autosweep/autosweep/data_types/__init__.py", "repo_id": "autosweep", "token_count": 263 }
0
from autosweep.instruments import abs_instr from autosweep.instruments.coms import visa_coms class Keysight8164B(abs_instr.AbsInstrument): """ Driver written by Helge Gehring, modified to work with AutoSweep. :param addrs: The VISA-resource string for this instrument :type addrs: str """ def...
autosweep/autosweep/instruments/optical/Keysight8164B.py/0
{ "file_path": "autosweep/autosweep/instruments/optical/Keysight8164B.py", "repo_id": "autosweep", "token_count": 1897 }
1
import logging from autosweep.utils.params import logger_format, logger_level from autosweep.utils.typing_ext import PathLike def init_logger(path: PathLike | None = None) -> logging.Logger: """ Used to configure the logging package for use inside this package. Can be used with other scripts as well. :p...
autosweep/autosweep/utils/logger.py/0
{ "file_path": "autosweep/autosweep/utils/logger.py", "repo_id": "autosweep", "token_count": 339 }
2
import logging import pathlib from autosweep.data_types.metadata import PN, SN, DUTInfo, TimeStamp from autosweep.data_types.recipe import Recipe from autosweep.utils.logger import init_logger def test_types(): init_logger() pn = PN(num="ABC-12345", rev="123") logging.info(f"{pn = }") logging.info(f"...
autosweep/tests/data_types/test_types.py/0
{ "file_path": "autosweep/tests/data_types/test_types.py", "repo_id": "autosweep", "token_count": 549 }
3
# Table of contents # Learn more at https://jterbook.org/customize/toc.html format: jb-book root: index parts: - caption: Introduction chapters: - file: notebooks/10_layout.ipynb - file: notebooks/10_layout_full.ipynb - file: notebooks/11_drc.ipynb - file: notebooks/20_modesolver_fem.ipyn...
gdsfactory-photonics-training/docs/_toc.yml/0
{ "file_path": "gdsfactory-photonics-training/docs/_toc.yml", "repo_id": "gdsfactory-photonics-training", "token_count": 299 }
4
plot_modes: false resolution: 10 compute_time_seconds: 328.1761336326599 compute_time_minutes: 5.4696022272109985
gdsfactory-test-data/sp/bend_euler_5689b551_f3e429c3.yml/0
{ "file_path": "gdsfactory-test-data/sp/bend_euler_5689b551_f3e429c3.yml", "repo_id": "gdsfactory-test-data", "token_count": 44 }
5
resolution: 30 port_symmetries: o1@0,o1@0: - o2@0,o2@0 o2@0,o1@0: - o1@0,o2@0 wavelength_start: 1.5 wavelength_stop: 1.6 wavelength_points: 50 port_margin: 2 port_monitor_offset: -0.1 port_source_offset: -0.1 dispersive: false ymargin_top: 0.0 ymargin_bot: 3.0 xmargin_left: 0 xmargin_right: 3.0 layer_stack: c...
gdsfactory-test-data/sp/bend_euler_radius3_aaceb38e.yml/0
{ "file_path": "gdsfactory-test-data/sp/bend_euler_radius3_aaceb38e.yml", "repo_id": "gdsfactory-test-data", "token_count": 1317 }
6
["E0",""] ["E1",""] ["W0",""] ["W1",""] ("W0","mode 1",1,"W0",1,"transmission") (500, 3) 1.4989622900000000e+14 3.5765357409040605e-02 3.0963032335069682e+00 1.5019662224448897e+14 3.7329762253506225e-02 3.2180919456337933e+00 1.5049701548897797e+14 3.3720235411483210e-02 3.3192338160320403e+00 1.5079740873346694e+14 2...
gdsfactory-test-data/sp/coupler/coupler_G224n_L20_S220.dat/0
{ "file_path": "gdsfactory-test-data/sp/coupler/coupler_G224n_L20_S220.dat", "repo_id": "gdsfactory-test-data", "token_count": 296139 }
7
simulation_settings: background_material: sio2 port_margin: 1.5 port_extension: 2.0 mesh_accuracy: 1 zmargin: 1.0 ymargin: 2.0 xmargin: 0.5 pml_margin: 0.5 wavelength_start: 1.2 wavelength_stop: 1.6 wavelength_points: 200 simulation_time: 1.0e-11 simulation_temperature: 300.0 mode_index: 0 ...
gdsfactory-test-data/sp/mmi1x2_mesh_accuracy1_si220n_w_dc021729.yml/0
{ "file_path": "gdsfactory-test-data/sp/mmi1x2_mesh_accuracy1_si220n_w_dc021729.yml", "repo_id": "gdsfactory-test-data", "token_count": 1958 }
8
is_3d: false compute_time_seconds: 34.20280599594116 compute_time_minutes: 0.5700467665990193
gdsfactory-test-data/sp/straight_46b2e15a.yml/0
{ "file_path": "gdsfactory-test-data/sp/straight_46b2e15a.yml", "repo_id": "gdsfactory-test-data", "token_count": 40 }
9
["o1","LEFT"] ["o2","LEFT"] ("o1","mode 1",1,"o1",1,"transmission") (500, 3) 1.8737028625000000e+14 2.5843023039485484e-05 4.9325493894361572e-01 1.8749545010187041e+14 2.7779621157981651e-05 4.0275901341316012e-01 1.8762061395374081e+14 2.9866139769754776e-05 3.2521435297950219e-01 1.8774577780561122e+14 3.20623869426...
gdsfactory-test-data/sp/straight_fba69bc3_7d88a4d7.dat/0
{ "file_path": "gdsfactory-test-data/sp/straight_fba69bc3_7d88a4d7.dat", "repo_id": "gdsfactory-test-data", "token_count": 73387 }
10
```{include} ../CHANGELOG.md ```
gdsfactory/docs/changelog.md/0
{ "file_path": "gdsfactory/docs/changelog.md", "repo_id": "gdsfactory", "token_count": 17 }
11
"""Add Label to each component port.""" from __future__ import annotations from collections.abc import Callable from functools import partial import gdsfactory as gf from gdsfactory.component import Component, ComponentReference from gdsfactory.component_layout import _parse_layer from gdsfactory.port import Port fr...
gdsfactory/gdsfactory/add_labels.py/0
{ "file_path": "gdsfactory/gdsfactory/add_labels.py", "repo_id": "gdsfactory", "token_count": 5101 }
12
"""Each component factory component returns a component. Make sure your components get imported here so the PDK registers them. """ from __future__ import annotations import sys from functools import partial from gdsfactory.components.add_fiber_array_optical_south_electrical_north import ( add_fiber_array_optic...
gdsfactory/gdsfactory/components/__init__.py/0
{ "file_path": "gdsfactory/gdsfactory/components/__init__.py", "repo_id": "gdsfactory", "token_count": 8772 }
13
from __future__ import annotations import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.components.dbr import dbr from gdsfactory.typings import ComponentSpec @gf.cell_with_child def cavity( component: ComponentSpec = dbr, coupler: ComponentSpec = "coupler", length: float = ...
gdsfactory/gdsfactory/components/cavity.py/0
{ "file_path": "gdsfactory/gdsfactory/components/cavity.py", "repo_id": "gdsfactory", "token_count": 742 }
14
from __future__ import annotations import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.components.cross import cross from gdsfactory.typings import ComponentSpec, LayerSpecs @gf.cell_with_child def copy_layers( factory: ComponentSpec = cross, layers: LayerSpecs = ((1, 0), (2, 0)), ...
gdsfactory/gdsfactory/components/copy_layers.py/0
{ "file_path": "gdsfactory/gdsfactory/components/copy_layers.py", "repo_id": "gdsfactory", "token_count": 306 }
15
from __future__ import annotations import warnings import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.components.bend_euler import bend_euler180 from gdsfactory.components.straight import straight from gdsfactory.typings import ComponentSpec, CrossSectionSpec diagram = r""" ...
gdsfactory/gdsfactory/components/delay_snake3.py/0
{ "file_path": "gdsfactory/gdsfactory/components/delay_snake3.py", "repo_id": "gdsfactory", "token_count": 1528 }
16
from __future__ import annotations import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.components.bend_euler import bend_euler from gdsfactory.components.grating_coupler_elliptical import grating_coupler_elliptical from gdsfactory.typings import ComponentSpec @gf.cell def grating_coupl...
gdsfactory/gdsfactory/components/grating_coupler_array.py/0
{ "file_path": "gdsfactory/gdsfactory/components/grating_coupler_array.py", "repo_id": "gdsfactory", "token_count": 1236 }
17
from __future__ import annotations from collections.abc import Sequence import numpy as np import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.components.interdigital_capacitor import interdigital_capacitor from gdsfactory.typings import LayerSpec @gf.cell def interdigital_capacitor_...
gdsfactory/gdsfactory/components/interdigital_capacitor_enclosed.py/0
{ "file_path": "gdsfactory/gdsfactory/components/interdigital_capacitor_enclosed.py", "repo_id": "gdsfactory", "token_count": 1423 }
18
from __future__ import annotations import gdsfactory as gf from gdsfactory.cell import cell from gdsfactory.component import Component from gdsfactory.components.coupler import coupler as coupler_function from gdsfactory.components.mmi2x2 import mmi2x2 as mmi_splitter_function from gdsfactory.components.mzi import mzi...
gdsfactory/gdsfactory/components/mzi_lattice.py/0
{ "file_path": "gdsfactory/gdsfactory/components/mzi_lattice.py", "repo_id": "gdsfactory", "token_count": 5980 }
19
from __future__ import annotations import numpy as np import gdsfactory as gf from gdsfactory.cell import cell from gdsfactory.component import Component from gdsfactory.components.array_component import array from gdsfactory.components.rectangle import rectangle from gdsfactory.typings import Float2, LayerSpec @ce...
gdsfactory/gdsfactory/components/rectangle_with_slits.py/0
{ "file_path": "gdsfactory/gdsfactory/components/rectangle_with_slits.py", "repo_id": "gdsfactory", "token_count": 1423 }
20
from __future__ import annotations from functools import partial import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.components.bend_euler import bend_euler from gdsfactory.components.coupler_ring import coupler_ring from gdsfactory.components.straight import straight from gdsfactory.co...
gdsfactory/gdsfactory/components/ring_single_dut.py/0
{ "file_path": "gdsfactory/gdsfactory/components/ring_single_dut.py", "repo_id": "gdsfactory", "token_count": 1120 }
21
from __future__ import annotations from functools import partial import gdsfactory as gf from gdsfactory.cell import cell from gdsfactory.component import Component from gdsfactory.components.straight import straight as straight_function from gdsfactory.typings import ComponentSpec, CrossSectionSpec @cell def strai...
gdsfactory/gdsfactory/components/straight_heater_metal.py/0
{ "file_path": "gdsfactory/gdsfactory/components/straight_heater_metal.py", "repo_id": "gdsfactory", "token_count": 4220 }
22
from __future__ import annotations import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.typings import Floats, LayerSpec @gf.cell def verniers( widths: Floats = (0.1, 0.2, 0.3, 0.4, 0.5), gap: float = 0.1, xsize: float = 100.0, layer_label: LayerSpec = "TEXT", **kwar...
gdsfactory/gdsfactory/components/verniers.py/0
{ "file_path": "gdsfactory/gdsfactory/components/verniers.py", "repo_id": "gdsfactory", "token_count": 427 }
23
import sys from gdsfactory.difftest import diff def gdsdiff_git( path: str = "", curr_file: str = "", old_file: str = "", old_hex: str = "", old_mode: str = "", new_file: str = "", new_hex: str = "", new_mode: str = "", ) -> None: """Show diffs for two files when running git diff....
gdsfactory/gdsfactory/difftest_git.py/0
{ "file_path": "gdsfactory/gdsfactory/difftest_git.py", "repo_id": "gdsfactory", "token_count": 323 }
24
This folder is for the KLayout Salt package Then you can register the package: ``` gdsfactory/gdsfactory.git/branches/main/gdsfactory/generic_tech/klayout ```
gdsfactory/gdsfactory/generic_tech/klayout/README.md/0
{ "file_path": "gdsfactory/gdsfactory/generic_tech/klayout/README.md", "repo_id": "gdsfactory", "token_count": 55 }
25
####################### # cross-section settings script for Klayout using generic layer map # https://sourceforge.net/p/xsectionklayout/wiki/MainPage/ # Download the ruby module here: http://sourceforge.net/p/xsectionklayout/code/HEAD/tree/trunk/src/xsection.rbm?format=raw # Copy xsection.lym to the installation path o...
gdsfactory/gdsfactory/generic_tech/klayout/xsection/xsection_generic.xs/0
{ "file_path": "gdsfactory/gdsfactory/generic_tech/klayout/xsection/xsection_generic.xs", "repo_id": "gdsfactory", "token_count": 1932 }
26
import gdstk import numpy as np from gdstk import Polygon import gdsfactory as gf def manhattanize_polygon( p: Polygon, target_step: float = 0.05, ) -> Polygon: """Return a Manhattanized version of the input polygon (where non-x and non-y parallel segments are decomposed into a staircase of small x and y...
gdsfactory/gdsfactory/geometry/manhattanize.py/0
{ "file_path": "gdsfactory/gdsfactory/geometry/manhattanize.py", "repo_id": "gdsfactory", "token_count": 1684 }
27
from __future__ import annotations from functools import partial import flatdict import gdsfactory as gf from gdsfactory.snap import snap_to_grid as snap from gdsfactory.typings import Layer ignore = ( "cross_section", "decorator", "cross_section1", "cross_section2", "contact", "pad", ) pref...
gdsfactory/gdsfactory/labels/ehva.py/0
{ "file_path": "gdsfactory/gdsfactory/labels/ehva.py", "repo_id": "gdsfactory", "token_count": 1500 }
28
from __future__ import annotations from gdsfactory.cell import cell_without_validator from gdsfactory.component import Component, ComponentReference @cell_without_validator def from_dphox(device, foundry) -> Component: """Returns Gdsfactory Component from a dphox Device. Note that you need to install dphox ...
gdsfactory/gdsfactory/read/from_dphox.py/0
{ "file_path": "gdsfactory/gdsfactory/read/from_dphox.py", "repo_id": "gdsfactory", "token_count": 798 }
29
import warnings from collections.abc import Callable import numpy as np from gdsfactory.component import Component, ComponentReference, Port from gdsfactory.components.bend_euler import bend_euler from gdsfactory.components.straight import straight as straight_function from gdsfactory.config import CONF from gdsfacto...
gdsfactory/gdsfactory/routing/all_angle.py/0
{ "file_path": "gdsfactory/gdsfactory/routing/all_angle.py", "repo_id": "gdsfactory", "token_count": 18856 }
30
from __future__ import annotations import warnings from gdsfactory.components.bend_s import bend_s from gdsfactory.port import Port from gdsfactory.typings import ComponentFactory, Route def get_route_sbend( port1: Port, port2: Port, *, bend_s: ComponentFactory = bend_s, **kwargs ) -> Route: """Returns an S...
gdsfactory/gdsfactory/routing/get_route_sbend.py/0
{ "file_path": "gdsfactory/gdsfactory/routing/get_route_sbend.py", "repo_id": "gdsfactory", "token_count": 1527 }
31
"""When you create components you have to make sure they have unique names. the cell decorator gives unique names to components that depend on their parameters. """ from __future__ import annotations import gdsfactory as gf if __name__ == "__main__": c1 = gf.components.straight(length=5) assert c1.name.spli...
gdsfactory/gdsfactory/samples/02_component_autoname.py/0
{ "file_path": "gdsfactory/gdsfactory/samples/02_component_autoname.py", "repo_id": "gdsfactory", "token_count": 105 }
32
"""# Components. You can adapt some component functions from the `gdsfactory.components` module. Each function there returns a Component object. Here are two equivalent functions.""" from __future__ import annotations from functools import partial import gdsfactory as gf def straight_wide1(width=10, **kwargs) -> g...
gdsfactory/gdsfactory/samples/20_components.py/0
{ "file_path": "gdsfactory/gdsfactory/samples/20_components.py", "repo_id": "gdsfactory", "token_count": 178 }
33
instances: {% for i in range(5) %} wg_a1{{ i }}: component: straight wg_a2{{ i }}: component: straight settings: cross_section: xs_sc wg_b1{{ i }}: component: straight settings: cross_section: xs_sc wg_b2{{ i }}: component: straight wg_c1{{ i }}: component: straight ...
gdsfactory/gdsfactory/samples/all_angle_routing/aar_bundles.pic.yml/0
{ "file_path": "gdsfactory/gdsfactory/samples/all_angle_routing/aar_bundles.pic.yml", "repo_id": "gdsfactory", "token_count": 2991 }
34
instances: mzi1: component: mzi settings: delta_length: 200 mzi2: component: mzi settings: delta_length: 10 gc1: component: grating_coupler_te gc2: component: grating_coupler_te placements: mzi2: ymax: mzi1,north dy: 100 xmin: mzi1,east dx: 50 gc1: ...
gdsfactory/gdsfactory/samples/demo/circuits/mzi_lattice_filter_generic.pic.yml/0
{ "file_path": "gdsfactory/gdsfactory/samples/demo/circuits/mzi_lattice_filter_generic.pic.yml", "repo_id": "gdsfactory", "token_count": 369 }
35
"""Write FabC example PDK into uPDK YAML format.""" from __future__ import annotations from gdsfactory.samples.pdk.fab_c import pdk if __name__ == "__main__": yaml_pdk_decription = pdk.to_updk() print(yaml_pdk_decription)
gdsfactory/gdsfactory/samples/pdk/fab_c_to_updk.py/0
{ "file_path": "gdsfactory/gdsfactory/samples/pdk/fab_c_to_updk.py", "repo_id": "gdsfactory", "token_count": 94 }
36
function: grating_coupler_elliptical info: polarization: te wavelength: 1.554 module: gdsfactory.components.grating_coupler_elliptical name: grating_coupler_elliptical_e6e61720 settings: big_last_tooth: false cross_section: add_pins_function_module: gdsfactory.samples.pdk.fab_c add_pins_function_name: a...
gdsfactory/gdsfactory/samples/pdk/test_fab_c/test_settings_gc_nc_.yml/0
{ "file_path": "gdsfactory/gdsfactory/samples/pdk/test_fab_c/test_settings_gc_nc_.yml", "repo_id": "gdsfactory", "token_count": 690 }
37
from pydantic.dataclasses import dataclass from gdsfactory.technology.layer_views import Layer @dataclass(kw_only=True) class ProcessStep: """Generic process step.""" name: str | None @dataclass(kw_only=True) class Lithography(ProcessStep): """Simulates lithography by generating a logical on-wafer mas...
gdsfactory/gdsfactory/technology/processes.py/0
{ "file_path": "gdsfactory/gdsfactory/technology/processes.py", "repo_id": "gdsfactory", "token_count": 4804 }
38
<jupyter_start><jupyter_text>Grid / pack / align / distribute GridThe ``gf.components.grid()`` function can take a list (or 2D array) of objects and arrange them along a grid. This is often useful for making parameter sweeps. If the `separation` argument is true, grid is arranged such that the elements are guarantee...
gdsfactory/notebooks/04_components_pack.ipynb/0
{ "file_path": "gdsfactory/notebooks/04_components_pack.ipynb", "repo_id": "gdsfactory", "token_count": 2638 }
39
<jupyter_start><jupyter_text>Git: Version control intro “Revision control, also known as version control, source controlmanages changes to documents, programs, and other information stored as computer files -- Wikipedia **Reproducibility?*** Tracking and recreating every step of your work* In the software world: it's c...
gdsfactory/notebooks/_1_git.ipynb/0
{ "file_path": "gdsfactory/notebooks/_1_git.ipynb", "repo_id": "gdsfactory", "token_count": 3603 }
40
default_settings: n_bundle: value: 3 description: "The number of routes in the bundle" instances: {% for i in range(n_bundle) %} wg_start_{{ i }}: component: straight wg_end_{{ i }}: component: straight {% endfor %} obstacle1: component: rectangle settings: layer: ...
gdsfactory/notebooks/yaml_pics/aar_bundles02.pic.yml/0
{ "file_path": "gdsfactory/notebooks/yaml_pics/aar_bundles02.pic.yml", "repo_id": "gdsfactory", "token_count": 846 }
41
name: ports_demo instances: mmi_long: component: mmi1x2 settings: width_mmi: 4.5 length_mmi: 5 placements: mmi_long: port: o1 x: 20 y: 10 mirror: True ports: o3: mmi_long,o3 o2: mmi_long,o2 o1: mmi_long,o1
gdsfactory/notebooks/yaml_pics/ports_demo.pic.yml/0
{ "file_path": "gdsfactory/notebooks/yaml_pics/ports_demo.pic.yml", "repo_id": "gdsfactory", "token_count": 175 }
42
function: _from_yaml info: {} module: gdsfactory.read.from_yaml name: mirror_port_f610a6e9 settings: conf: instances: mmi_long: component: mmi1x2 settings: length_mmi: 5 width_mmi: 4.5 name: mirror_port placements: mmi_long: mirror: true port...
gdsfactory/test-data-regression/test_components_0_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_components_0_.yml", "repo_id": "gdsfactory", "token_count": 672 }
43
0: 492.274 1: 292.941
gdsfactory/test-data-regression/test_get_bundle_optical.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_get_bundle_optical.yml", "repo_id": "gdsfactory", "token_count": 14 }
44
function: '' info: {} module: '' name: straight_container_ceeea98c settings: {}
gdsfactory/test-data-regression/test_import_ports_inside.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_import_ports_inside.yml", "repo_id": "gdsfactory", "token_count": 28 }
45
connections: bend_euler_1,o1: straight_1,o2 bend_euler_1,o2: straight_2,o1 bend_euler_2,o1: straight_2,o2 bend_euler_2,o2: straight_3,o1 mmi_long,o1: straight_3,o2 mmi_short,o2: straight_1,o1 instances: bend_euler_1: component: bend_euler info: dy: 10.0 length: 16.637 radius: 10....
gdsfactory/test-data-regression/test_netlists_sample_mmis_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_netlists_sample_mmis_.yml", "repo_id": "gdsfactory", "token_count": 3187 }
46
function: aar_start_end_customizations info: {} module: yaml_jinja name: aar_start_end_customizations settings: {}
gdsfactory/test-data-regression/test_settings_aar_start_end_customizations_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_aar_start_end_customizations_.yml", "repo_id": "gdsfactory", "token_count": 40 }
47
function: add_pads_bot info: {} module: gdsfactory.routing.add_pads name: mzi_add_pads_bot_componentmzi_2e88f57c settings: bend: wire_corner component: function: mzi module: gdsfactory.components.mzi settings: add_electrical_ports_bot: true add_optical_ports_arms: false bend: f...
gdsfactory/test-data-regression/test_settings_add_pads_bot_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_add_pads_bot_.yml", "repo_id": "gdsfactory", "token_count": 667 }
48
function: bend_euler info: dy: 0.0 length: 42.817 radius: 10.0 radius_min: 9.086 route_info_length: 42.817 route_info_n_bend_90: 2.0 route_info_type: xs_sc route_info_weight: 42.817 route_info_xs_sc_length: 42.817 width: 0.5 module: gdsfactory.components.bend_euler name: bend_euler_angle180 settings...
gdsfactory/test-data-regression/test_settings_bend_euler180_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_bend_euler180_.yml", "repo_id": "gdsfactory", "token_count": 195 }
49
function: coh_rx_dual_pol info: {} module: gdsfactory.components.coh_rx_dual_pol name: coh_rx_dual_pol settings: bend: function: bend_euler cross_section: xs_sc lo_input_coupler: null lo_splitter: mmi1x2 signal_input_coupler: null signal_splitter: null single_pol_rx_spacing: 50.0 splitter_coh_rx_spa...
gdsfactory/test-data-regression/test_settings_coh_rx_dual_pol_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_coh_rx_dual_pol_.yml", "repo_id": "gdsfactory", "token_count": 168 }
50
function: coupler_bent info: {} module: gdsfactory.components.coupler_bent name: coupler_bent settings: cross_section: xs_sc gap: 0.2 length: 8.6 length_straight: 10 radius: 26 width1: 0.4 width2: 0.4
gdsfactory/test-data-regression/test_settings_coupler_bent_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_coupler_bent_.yml", "repo_id": "gdsfactory", "token_count": 89 }
51
function: cutback_bend180 info: n_bends: 82 module: gdsfactory.components.cutback_bend name: cutback_bend180_851c64c0 settings: cols: 6 component: function: bend_circular module: gdsfactory.components.bend_circular settings: angle: 180 rows: 6 spacing: 3 straight: function: straight ...
gdsfactory/test-data-regression/test_settings_cutback_bend180circular_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_cutback_bend180circular_.yml", "repo_id": "gdsfactory", "token_count": 139 }
52
function: die_bbox_frame info: {} module: gdsfactory.components.die_bbox_frame name: die_bbox_frame settings: bbox: - - -1.0 - -1.0 - - 3.0 - 4.0 die_name: null layer: MTOP padding: 10.0 street_length: 1000.0 street_width: 100.0 text_anchor: sw text_size: 100.0
gdsfactory/test-data-regression/test_settings_die_bbox_frame_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_die_bbox_frame_.yml", "repo_id": "gdsfactory", "token_count": 134 }
53
function: grating_coupler_elliptical_arbitrary info: polarization: te wavelength: 1.554 module: gdsfactory.components.grating_coupler_elliptical_arbitrary name: grating_coupler_elliptical_arbitrary settings: bias_gap: 0 cross_section: xs_sc fiber_angle: 15.0 gaps: - 0.1 - 0.1 - 0.1 - 0.1 - 0.1 -...
gdsfactory/test-data-regression/test_settings_grating_coupler_elliptical_arbitrary_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_grating_coupler_elliptical_arbitrary_.yml", "repo_id": "gdsfactory", "token_count": 311 }
54
function: greek_cross_offset_pads info: {} module: gdsfactory.components.greek_cross name: greek_cross_offset_pads settings: contact_buffer: 10 contact_layers: - WG - NPP contact_offset: 10 cross_implant_layers: - N cross_implant_length: 30.0 cross_implant_width: 2.0 cross_struct_layers: - WG cr...
gdsfactory/test-data-regression/test_settings_greek_cross_offset_pads_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_greek_cross_offset_pads_.yml", "repo_id": "gdsfactory", "token_count": 158 }
55
function: mmi1x2 info: {} module: gdsfactory.components.mmi1x2 name: mmi1x2 settings: cross_section: xs_sc 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
gdsfactory/test-data-regression/test_settings_mmi1x2_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_mmi1x2_.yml", "repo_id": "gdsfactory", "token_count": 117 }
56
function: pad_gsg_short info: {} module: gdsfactory.components.pad_gsg name: pad_gsg_short_shortFalse settings: layer_metal: MTOP metal_spacing: 5.0 pad: function: pad pad_spacing: 150 short: false size: - 22 - 7 via_stack: function: rectangle module: gdsfactory.components.rectangle se...
gdsfactory/test-data-regression/test_settings_pad_gsg_open_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_pad_gsg_open_.yml", "repo_id": "gdsfactory", "token_count": 142 }
57
function: ring_crow info: {} module: gdsfactory.components.ring_crow name: ring_crow settings: bends: - function: bend_circular - function: bend_circular - function: bend_circular gaps: - 0.2 - 0.2 - 0.2 - 0.2 input_straight_cross_section: function: cross_section module: gdsfactory.cross_sec...
gdsfactory/test-data-regression/test_settings_ring_crow_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_ring_crow_.yml", "repo_id": "gdsfactory", "token_count": 409 }
58
function: _from_yaml info: {} module: gdsfactory.read.from_yaml name: sample_docstring_e2d59879 settings: conf: instances: mmi_bot: component: mmi1x2 settings: length_mmi: 11 width_mmi: 5 mmi_top: component: mmi1x2 settings: length_mmi: 22 ...
gdsfactory/test-data-regression/test_settings_sample_docstring_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_sample_docstring_.yml", "repo_id": "gdsfactory", "token_count": 803 }
59
function: spiral_racetrack_fixed_length info: length: 999.9991273714644 straight_length: 65.46151592143306 module: gdsfactory.components.spiral_heater name: spiral_racetrack_fixed_length settings: bend_factory: function: bend_euler bend_s_factory: function: bend_s cross_section: xs_sc cross_section_...
gdsfactory/test-data-regression/test_settings_spiral_racetrack_fixed_length_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_spiral_racetrack_fixed_length_.yml", "repo_id": "gdsfactory", "token_count": 203 }
60
function: taper_parabolic info: {} module: gdsfactory.components.taper_parabolic name: taper_parabolic settings: exp: 0.5 layer: WG length: 20 npoints: 100 width1: 0.5 width2: 5.0
gdsfactory/test-data-regression/test_settings_taper_parabolic_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_taper_parabolic_.yml", "repo_id": "gdsfactory", "token_count": 79 }
61
function: transition info: {} module: test_paths name: transition settings: {}
gdsfactory/test-data-regression/test_settings_transition_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_transition_.yml", "repo_id": "gdsfactory", "token_count": 23 }
62
function: via_stack_corner45_extended info: {} module: gdsfactory.components.via_stack name: via_stack_corner45_extended settings: corner: function: via_stack_corner45 length: 10 via_stack: function: via_stack width: 3
gdsfactory/test-data-regression/test_settings_via_stack_corner45_extended_.yml/0
{ "file_path": "gdsfactory/test-data-regression/test_settings_via_stack_corner45_extended_.yml", "repo_id": "gdsfactory", "token_count": 89 }
63
import pathlib import pytest from gdsfactory.config import PATH, logger @pytest.fixture(scope="session") def datadir() -> pathlib.Path: return PATH.repo / "test-data-regression" @pytest.fixture(scope="session") def original_datadir() -> pathlib.Path: return PATH.repo / "test-data-regression" @pytest.fix...
gdsfactory/tests/conftest.py/0
{ "file_path": "gdsfactory/tests/conftest.py", "repo_id": "gdsfactory", "token_count": 209 }
64
from __future__ import annotations from pytest_regressions.data_regression import DataRegressionFixture import gdsfactory as gf def demo_get_bundle_sbend_routing( data_regression: DataRegressionFixture, check: bool = True ) -> None: """FIXME.""" lengths = {} c = gf.Component("test_get_bundle_sort_...
gdsfactory/tests/routing/test_routing_get_bundle_sbend_routing.py/0
{ "file_path": "gdsfactory/tests/routing/test_routing_get_bundle_sbend_routing.py", "repo_id": "gdsfactory", "token_count": 469 }
65
from __future__ import annotations from functools import partial import gdsfactory as gf from gdsfactory.add_pins import ( add_bbox_siepic, add_pin_rectangle_inside, add_pins_siepic, ) from gdsfactory.component import Component from gdsfactory.port import Port cladding_layers_optical_siepic = ("DEVREC",)...
gdsfactory/tests/test_add_pins.py/0
{ "file_path": "gdsfactory/tests/test_add_pins.py", "repo_id": "gdsfactory", "token_count": 1270 }
66
from gdstk import Polygon import gdsfactory as gf def test_move() -> None: c = gf.Component() mzi = c.add_ref(gf.components.mzi()) bend = c.add_ref(gf.components.bend_euler()) bend.move("o1", mzi.ports["o2"]) def test_get_polygons() -> None: ref = gf.components.straight() p0 = ref.get_polyg...
gdsfactory/tests/test_component_reference.py/0
{ "file_path": "gdsfactory/tests/test_component_reference.py", "repo_id": "gdsfactory", "token_count": 897 }
67
from __future__ import annotations import gdsfactory as gf def test_flatten() -> None: c1 = gf.components.mzi() c2 = c1.flatten() assert len(c1.references) > 0, f"{len(c1.references)}" assert len(c2.references) == 0, f"{len(c2.references)}" assert c1.name != c2.name, f"{c1.name} must be differen...
gdsfactory/tests/test_flatten.py/0
{ "file_path": "gdsfactory/tests/test_flatten.py", "repo_id": "gdsfactory", "token_count": 538 }
68
from __future__ import annotations import gdsfactory as gf @gf.cell def component_with_label() -> None: c = gf.Component("component_with_label") _ = c << gf.components.rectangle() c.add_label(text="demo", position=(0.0, 0.0), layer=(66, 0)) def test_label_move() -> None: """test that when we move r...
gdsfactory/tests/test_label_move.py/0
{ "file_path": "gdsfactory/tests/test_label_move.py", "repo_id": "gdsfactory", "token_count": 230 }
69
from __future__ import annotations from functools import partial import gdsfactory as gf @gf.cell def mmi_with_bend( mmi=gf.components.mmi1x2, bend=gf.components.bend_circular ) -> gf.Component: c = gf.Component() mmi = c << mmi() bend = c << bend() bend.connect("o2", mmi.ports["o2"]) return...
gdsfactory/tests/test_partial_function.py/0
{ "file_path": "gdsfactory/tests/test_partial_function.py", "repo_id": "gdsfactory", "token_count": 555 }
70
from __future__ import annotations import pytest from pytest_regressions.data_regression import DataRegressionFixture import gdsfactory as gf @pytest.mark.parametrize("port_type", ["electrical", "optical", "placement"]) def test_rename_ports(port_type, data_regression: DataRegressionFixture): c = gf.components....
gdsfactory/tests/test_rename_ports.py/0
{ "file_path": "gdsfactory/tests/test_rename_ports.py", "repo_id": "gdsfactory", "token_count": 207 }
71
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: e...
gf180/.pre-commit-config.yaml/0
{ "file_path": "gf180/.pre-commit-config.yaml", "repo_id": "gf180", "token_count": 1135 }
72
import gdsfactory as gf import numpy as np from gdsfactory.typings import Float2, LayerSpec from gf180.layers import layer from gf180.via_generator import via_generator, via_stack @gf.cell def cap_mos_inst( lc: float = 0.1, wc: float = 0.1, cmp_w: float = 0.1, con_w: float = 0.1, pl_l: float = 0....
gf180/gf180/cap_mos.py/0
{ "file_path": "gf180/gf180/cap_mos.py", "repo_id": "gf180", "token_count": 9147 }
73
# Copyright 2022 GlobalFoundries PDK Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
gf180/gf180/cells/klayout/pymacros/cells/diode.py/0
{ "file_path": "gf180/gf180/cells/klayout/pymacros/cells/diode.py", "repo_id": "gf180", "token_count": 9167 }
74
import gdsfactory as gf import numpy as np from gdsfactory.typings import Float2 from gf180.layers import layer from gf180.via_generator import via_generator, via_stack @gf.cell def diode_nd2ps( la: float = 0.1, wa: float = 0.1, cw: float = 0.1, volt: str = "3.3V", deepnwell: bool = False, pc...
gf180/gf180/diode.py/0
{ "file_path": "gf180/gf180/diode.py", "repo_id": "gf180", "token_count": 36485 }
75
function: cap_mim info: {} module: gf180.cap_mim name: cap_mim settings: bot_label: '' label: false lc: 2 metal_level: M4 mim_option: A top_label: '' wc: 2
gf180/tests/test_components/test_pdk_settings_cap_mim_.yml/0
{ "file_path": "gf180/tests/test_components/test_pdk_settings_cap_mim_.yml", "repo_id": "gf180", "token_count": 78 }
76
function: pfet info: {} module: gf180.fet name: pfet settings: bulk: None con_bet_fin: 1 deepnwell: 0 g_label: [] gate_con_pos: alternating grw: 0.22 inter_sd_l: 0.24 interdig: 0 l_gate: 0.28 label: false nf: 1 patt: '' patt_label: false pcmpgr: 0 sd_con_col: 1 sd_label: [] sub_label: ...
gf180/tests/test_components/test_pdk_settings_pfet_.yml/0
{ "file_path": "gf180/tests/test_components/test_pdk_settings_pfet_.yml", "repo_id": "gf180", "token_count": 168 }
77
# FDTD Finite difference time domain (FDTD) simulations directly solve Maxwell’s equations, which are the fundamental description of the physics of classical electrodynamics. FDTD simulations compute the [Sparameters](https://en.wikipedia.org/wiki/Scattering_parameters) response of a component, which measures the inp...
gplugins/docs/plugins_fdtd.md/0
{ "file_path": "gplugins/docs/plugins_fdtd.md", "repo_id": "gplugins", "token_count": 225 }
78
import os import pickle from collections.abc import Callable from typing import Any def disk_memoize(filename: str, overwrite: bool = False) -> Callable: # Check if cache file exists and load it, otherwise start with an empty cache if os.path.exists(filename): with open(filename, "rb") as f: ...
gplugins/gplugins/common/utils/cache.py/0
{ "file_path": "gplugins/gplugins/common/utils/cache.py", "repo_id": "gplugins", "token_count": 542 }
79
from __future__ import annotations from .mode_solver import compute_component_slice_modes, compute_cross_section_modes __all__ = ("compute_cross_section_modes", "compute_component_slice_modes")
gplugins/gplugins/femwell/__init__.py/0
{ "file_path": "gplugins/gplugins/femwell/__init__.py", "repo_id": "gplugins", "token_count": 61 }
80
"""test meep sparameters.""" from __future__ import annotations import gdsfactory as gf import numpy as np import gplugins as sim import gplugins.gmeep as gm simulation_settings = dict(resolution=20, is_3d=False) def test_sparameters_straight() -> None: """Checks Sparameters for a straight waveguide.""" c...
gplugins/gplugins/gmeep/test_write_sparameters_meep.py/0
{ "file_path": "gplugins/gplugins/gmeep/test_write_sparameters_meep.py", "repo_id": "gplugins", "token_count": 2917 }
81
from __future__ import annotations from gplugins.common.utils.parse_layer_stack import ( get_layer_overlaps_z, get_layers_at_z, list_unique_layer_stack_z, map_unique_layer_stack_z, order_layer_stack, ) from gplugins.gmsh.get_mesh import create_physical_mesh, get_mesh from gplugins.gmsh.uz_xsection_...
gplugins/gplugins/gmsh/__init__.py/0
{ "file_path": "gplugins/gplugins/gmsh/__init__.py", "repo_id": "gplugins", "token_count": 402 }
82
from __future__ import annotations import klayout.db as pya from gdsfactory.component import Component from gdsfactory.typings import ComponentOrPath def check_exclusion( gdspath: ComponentOrPath, layer1: tuple[int, int] = (1, 0), layer2: tuple[int, int] = (2, 0), min_space: float = 0.150, dbu: f...
gplugins/gplugins/klayout/drc/check_exclusion.py/0
{ "file_path": "gplugins/gplugins/klayout/drc/check_exclusion.py", "repo_id": "gplugins", "token_count": 1165 }
83
from __future__ import annotations import gdsfactory as gf import numpy as np import pytest from gdsfactory.component import Component from gplugins.klayout.drc.check_inclusion import check_inclusion @gf.cell def component_min_inclusion( inclusion: float, width: float = 0.5, layer1: tuple[int, int] = (1...
gplugins/gplugins/klayout/tests/test_drc_inclusion.py/0
{ "file_path": "gplugins/gplugins/klayout/tests/test_drc_inclusion.py", "repo_id": "gplugins", "token_count": 480 }
84
from __future__ import annotations import pathlib import tempfile import meep as mp import numpy as np import pydantic from meep import mpb mpb.Verbosity(0) tmp = pathlib.Path(tempfile.TemporaryDirectory().name).parent / "meep" tmp.mkdir(exist_ok=True) Floats = tuple[float, ...] @pydantic.validate_call def get_m...
gplugins/gplugins/modes/get_mode_solver_coupler.py/0
{ "file_path": "gplugins/gplugins/modes/get_mode_solver_coupler.py", "repo_id": "gplugins", "token_count": 3547 }
85
"""equations from paper https://doi.org/10.1364/OE.27.010456.""" dn_dt_si = 1.87e-4 dn_dt_sio2 = 8.5e-6 def delta_temperature_pi( length: float, wavelength: float = 1.55, dndT: float = 1.8e-4 ) -> float: return wavelength / (2.0 * length * dndT) if __name__ == "__main__": for length in [320, 600]: ...
gplugins/gplugins/photonic_circuit_models/heater.py/0
{ "file_path": "gplugins/gplugins/photonic_circuit_models/heater.py", "repo_id": "gplugins", "token_count": 191 }
86
from pathlib import Path import ray from gdsfactory.config import sparameters_path from gdsfactory.pdk import get_layer_stack from gdsfactory.read import import_gds from gplugins.gmeep import write_sparameters_meep from gplugins.sax.build_model import Model @ray.remote(num_cpus=1) def remote_output_from_inputs(**kw...
gplugins/gplugins/sax/integrations/meep_FDTD_model.py/0
{ "file_path": "gplugins/gplugins/sax/integrations/meep_FDTD_model.py", "repo_id": "gplugins", "token_count": 3194 }
87
from gplugins.tidy3d import materials, modes from gplugins.tidy3d.component import ( Tidy3DComponent, material_name_to_medium, write_sparameters, write_sparameters_batch, ) from gplugins.tidy3d.get_simulation_grating_coupler import ( get_simulation_grating_coupler, ) from gplugins.tidy3d.write_spara...
gplugins/gplugins/tidy3d/__init__.py/0
{ "file_path": "gplugins/gplugins/tidy3d/__init__.py", "repo_id": "gplugins", "token_count": 322 }
88
from __future__ import annotations import gdsfactory as gf import numpy as np import pytest import gplugins.tidy3d as gt @pytest.mark.parametrize("overwrite", [True, False]) def test_write_sparameters_straight_2d(overwrite=True) -> None: """Checks Sparameters for a straight waveguide in 2D.""" c = gf.compon...
gplugins/gplugins/tidy3d/tests/tests_sparameters/test_write_sparameters.py/0
{ "file_path": "gplugins/gplugins/tidy3d/tests/tests_sparameters/test_write_sparameters.py", "repo_id": "gplugins", "token_count": 417 }
89
<jupyter_start><jupyter_text>Klayout Design Rule Checking (DRC)Your device can be fabricated correctly when it meets the Design Rule Checks (DRC) from the foundry, you can write DRC rules from gdsfactory and customize the shortcut to run the checks in Klayout.Here are some rules explained in [repo generic DRC technolog...
gplugins/notebooks/klayout_drc.ipynb/0
{ "file_path": "gplugins/notebooks/klayout_drc.ipynb", "repo_id": "gplugins", "token_count": 1471 }
90
<jupyter_start><jupyter_text>Particle Swarm optimizationExample of particle swarm implementation based on PySwarms.This code demonstrates how to use the Particle Swarm Optimization (PSO) algorithmfrom the PySwarms library to optimize a function.The objective function used in this example is taken from the Ray Tune gene...
gplugins/notebooks/pso.ipynb/0
{ "file_path": "gplugins/notebooks/pso.ipynb", "repo_id": "gplugins", "token_count": 1338 }
91
--8<-- "CHANGELOG.md"
kfactory/docs/source/changelog.md/0
{ "file_path": "kfactory/docs/source/changelog.md", "repo_id": "kfactory", "token_count": 13 }
92
# Installation In conjunction with kfactory it is highly recommended to first install KLayout, an GDS and OASIS file viewer, and and klive, the plugin for loading gds files from KFactory. # KLayout [KLayout](https://www.klayout.de/intro.html) is an open source viewer for files produced by kfactory. To produce these ...
kfactory/docs/source/pre.md/0
{ "file_path": "kfactory/docs/source/pre.md", "repo_id": "kfactory", "token_count": 602 }
93
"""CLI interface for kfactory. Use `kf --help` for more info. """ import importlib import os import runpy import sys from enum import Enum from pathlib import Path from typing import Annotated, Optional import typer from ..conf import logger from ..kcell import KCell from ..kcell import show as kfshow # app = type...
kfactory/src/kfactory/cli/runshow.py/0
{ "file_path": "kfactory/src/kfactory/cli/runshow.py", "repo_id": "kfactory", "token_count": 1764 }
94
"""Core module of kfactory. Defines the [KCell][kfactory.kcell.KCell] providing klayout Cells with Ports and other convenience functions. [Instance][kfactory.kcell.Instance] are the kfactory instances used to also acquire ports and other inf from instances. """ from __future__ import annotations import functools i...
kfactory/src/kfactory/kcell.py/0
{ "file_path": "kfactory/src/kfactory/kcell.py", "repo_id": "kfactory", "token_count": 124239 }
95
"""Widgets for kfactory, currently for jupyterhub only."""
kfactory/src/kfactory/widgets/__init__.py/0
{ "file_path": "kfactory/src/kfactory/widgets/__init__.py", "repo_id": "kfactory", "token_count": 20 }
96
import kfactory as kf def test_layerstack_instance(pdk: kf.KCLayout) -> None: assert isinstance(pdk.layer_stack, kf.LayerStack) def test_layerstack_layer_thickness(pdk: kf.KCLayout) -> None: assert isinstance(pdk.layer_stack.get_layer_to_thickness()[(1, 0)], float) def test_layerstack_layer_zmin(pdk: kf.K...
kfactory/tests/test_layerstack.py/0
{ "file_path": "kfactory/tests/test_layerstack.py", "repo_id": "kfactory", "token_count": 660 }
97
"""Circular bends. A circular bend has a constant radius. """ import numpy as np from kfactory import kdb from kfactory.enclosure import LayerEnclosure, extrude_path from kfactory.kcell import KCell, LayerEnum, cell __all__ = ["bend_circular"] @cell def bend_circular( width: float, radius: float, layer...
kgeneric/kgeneric/cells/circular.py/0
{ "file_path": "kgeneric/kgeneric/cells/circular.py", "repo_id": "kgeneric", "token_count": 853 }
98
import kfactory as kf from kgeneric import gpdk as pdk if __name__ == "__main__": nm = 1e-3 c = kf.KCell("bend_chain") s1 = c << pdk.straight_sc(length=1 + 1.5 * nm) s2 = c << pdk.straight_sc(length=1) s2.connect("o1", s1.ports["o2"]) # b1.flatten() # b2.flatten() # c.flatten() c.s...
kgeneric/kgeneric/samples/straight_chain.py/0
{ "file_path": "kgeneric/kgeneric/samples/straight_chain.py", "repo_id": "kgeneric", "token_count": 165 }
99