diff --git a/CHANGELOG.md b/CHANGELOG.md index 856fad5e..09a96104 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.5.0] + +- update tests to pass for gdsfactory 5.0.0 + ## [1.4.2](https://github.com/gdsfactory/ubc/pull/20) - rename component_factory to cells and cross_section_factory to cross_sections diff --git a/docs/notebooks/00_layout.ipynb b/docs/notebooks/00_layout.ipynb index 1da279dd..b3642ae6 100644 --- a/docs/notebooks/00_layout.ipynb +++ b/docs/notebooks/00_layout.ipynb @@ -215,7 +215,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.9.10" } }, "nbformat": 4, diff --git a/docs/notebooks/11_sparameters.ipynb b/docs/notebooks/11_sparameters.ipynb index caa513ed..30910b8b 100644 --- a/docs/notebooks/11_sparameters.ipynb +++ b/docs/notebooks/11_sparameters.ipynb @@ -23,8 +23,8 @@ "import gdsfactory.simulation as sim\n", "import matplotlib.pyplot as plot\n", "\n", - "for component_factory in ubcpdk.component_factory.values():\n", - " component = component_factory()\n", + "for cell in ubcpdk.cells.values():\n", + " component = cell()\n", " # ubcpdk.tech.write_sparameters_lumerical(component=component)" ] }, diff --git a/docs/notebooks/12_circuit_simulation.ipynb b/docs/notebooks/12_circuit_simulation.ipynb index a9c77ce0..ec9f177b 100644 --- a/docs/notebooks/12_circuit_simulation.ipynb +++ b/docs/notebooks/12_circuit_simulation.ipynb @@ -186,7 +186,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.9.10" } }, "nbformat": 4, diff --git a/requirements.txt b/requirements.txt index 7bd9010a..9f83664a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -e . lygadgets -gdsfactory[full]==4.7.3 +gdsfactory[full]==5.0.0 modes diff --git a/ubcpdk/__init__.py b/ubcpdk/__init__.py index cd2a328a..30eab33b 100644 --- a/ubcpdk/__init__.py +++ b/ubcpdk/__init__.py @@ -36,7 +36,7 @@ logger.info(f"Found UBCpdk {__version__!r} installed at {module!r}") cells = get_cells(components) -PDK = Pdk(cells=cells, cross_sections=cross_sections) +PDK = Pdk(name="ubcpdk", cells=cells, cross_sections=cross_sections) PDK.activate() diff --git a/ubcpdk/components/__init__.py b/ubcpdk/components/__init__.py index 48805070..eb6744ad 100644 --- a/ubcpdk/components/__init__.py +++ b/ubcpdk/components/__init__.py @@ -32,12 +32,14 @@ from ubcpdk.components.straight import ( straight, ) +from ubcpdk.components.generic import coupler __all__ = [ "add_fiber_array", "bend_euler", "cells", + "coupler", "crossing", "dbr", "dbr_cavity", diff --git a/ubcpdk/components/cells.py b/ubcpdk/components/cells.py index 1197cd68..ff7be14e 100644 --- a/ubcpdk/components/cells.py +++ b/ubcpdk/components/cells.py @@ -96,7 +96,7 @@ def ebeam_dc_halfring_straight( "gap": gap * um, "radius": radius * um, "wg_thickness": thickness[LAYER.WG] * um, - "wg_width": x.info["width"] * um, + "wg_width": x.width * um, "Lc": length_x * um, } return component diff --git a/ubcpdk/components/generic.py b/ubcpdk/components/generic.py new file mode 100644 index 00000000..d90c6432 --- /dev/null +++ b/ubcpdk/components/generic.py @@ -0,0 +1,12 @@ +import gdsfactory as gf +from ubcpdk.import_gds import ( + add_ports_siepic_gratings, +) + + +coupler = gf.partial(gf.c.coupler, decorator=add_ports_siepic_gratings) + + +if __name__ == "__main__": + c = coupler() + c.show() diff --git a/ubcpdk/tests/test_components.gds/gds_ref/coupler_0bf175bc.gds b/ubcpdk/tests/test_components.gds/gds_ref/coupler_0bf175bc.gds new file mode 100644 index 00000000..48b03c93 Binary files /dev/null and b/ubcpdk/tests/test_components.gds/gds_ref/coupler_0bf175bc.gds differ diff --git a/ubcpdk/tests/test_components.gds/gds_ref/dbr.gds b/ubcpdk/tests/test_components.gds/gds_ref/dbr.gds index 7a3b8311..64092903 100644 Binary files a/ubcpdk/tests/test_components.gds/gds_ref/dbr.gds and b/ubcpdk/tests/test_components.gds/gds_ref/dbr.gds differ diff --git a/ubcpdk/tests/test_components.gds/gds_ref/dbr_cavity_a61b22bd.gds b/ubcpdk/tests/test_components.gds/gds_ref/dbr_cavity_a61b22bd.gds index a58ea60b..4702d024 100644 Binary files a/ubcpdk/tests/test_components.gds/gds_ref/dbr_cavity_a61b22bd.gds and b/ubcpdk/tests/test_components.gds/gds_ref/dbr_cavity_a61b22bd.gds differ diff --git a/ubcpdk/tests/test_components.gds/gds_ref/straight_87bde41b_strai_9c296313.gds b/ubcpdk/tests/test_components.gds/gds_ref/straight_87bde41b_strai_9c296313.gds new file mode 100644 index 00000000..295db19b Binary files /dev/null and b/ubcpdk/tests/test_components.gds/gds_ref/straight_87bde41b_strai_9c296313.gds differ diff --git a/ubcpdk/tests/test_components/test_pdk_settings_add_fiber_array_.yml b/ubcpdk/tests/test_components/test_pdk_settings_add_fiber_array_.yml index 96da29c3..01de5a76 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_add_fiber_array_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_add_fiber_array_.yml @@ -3,30 +3,34 @@ settings: child: changed: bend: - decorator: - - function: add_bbox_siepic - - function: add_pins_siepic function: bend_euler + settings: + decorator: + - function: add_bbox_siepic + - function: add_pins_siepic component: function: straight fanout_length: 0 gc_port_name: opt1 grating_coupler: - decorator: - - - function: add_ports_from_siepic_pins - - function: remove_pins - - function: add_pins_siepic_of_add_bbox_siepic - padding: -0.001 - - function: add_siepic_labels_and_simulation_info - - angle: 180 - function: rotate function: import_gds - gdsdir: gds - gdspath: ebeam_gc_te1550.gds - model: ebeam_gc_te1550 - opt1: opt_wg - polarization: te - wavelength: 1.55 + settings: + decorator: + - - function: add_ports_from_siepic_pins + - function: remove_pins + - function: add_pins_siepic_of_add_bbox_siepic + settings: + padding: -0.001 + - function: add_siepic_labels_and_simulation_info + - function: rotate + settings: + angle: 180 + gdsdir: gds + gdspath: ebeam_gc_te1550.gds + model: ebeam_gc_te1550 + opt1: opt_wg + polarization: te + wavelength: 1.55 layer_label: - 10 - 0 @@ -44,19 +48,19 @@ settings: default: cross_section: function: cross_section + settings: {} length: 10 npoints: 2 - with_cladding_box: true full: cross_section: function: cross_section + settings: {} layer: - 1 - 0 length: 10 npoints: 2 width: 0.5 - with_cladding_box: true function_name: straight info: length: 10.0 @@ -89,61 +93,70 @@ settings: component_name: null cross_section: function: cross_section + settings: {} gc_port_labels: null gc_port_name: o1 get_input_labels_function: function: get_input_labels grating_coupler: function: grating_coupler_elliptical_trenches - polarization: te - taper_angle: 35 + settings: + polarization: te + taper_angle: 35 layer_label: - 66 - 0 select_ports: function: select_ports - port_type: optical + settings: + port_type: optical straight: function: straight full: bend: - decorator: - - function: add_bbox_siepic - - function: add_pins_siepic function: bend_euler + settings: + decorator: + - function: add_bbox_siepic + - function: add_pins_siepic component: function: straight component_name: null cross_section: function: cross_section + settings: {} fanout_length: 0 gc_port_labels: null gc_port_name: opt1 get_input_labels_function: function: get_input_labels grating_coupler: - decorator: - - - function: add_ports_from_siepic_pins - - function: remove_pins - - function: add_pins_siepic_of_add_bbox_siepic - padding: -0.001 - - function: add_siepic_labels_and_simulation_info - - angle: 180 - function: rotate function: import_gds - gdsdir: gds - gdspath: ebeam_gc_te1550.gds - model: ebeam_gc_te1550 - opt1: opt_wg - polarization: te - wavelength: 1.55 + settings: + decorator: + - - function: add_ports_from_siepic_pins + - function: remove_pins + - function: add_pins_siepic_of_add_bbox_siepic + settings: + padding: -0.001 + - function: add_siepic_labels_and_simulation_info + - function: rotate + settings: + angle: 180 + gdsdir: gds + gdspath: ebeam_gc_te1550.gds + model: ebeam_gc_te1550 + opt1: opt_wg + polarization: te + wavelength: 1.55 layer_label: - 10 - 0 optical_routing_type: 0 select_ports: function: select_ports - port_type: optical + settings: + port_type: optical straight: function: straight with_loopback: false @@ -151,7 +164,7 @@ settings: info: {} info_version: 2 module: gdsfactory.routing.add_fiber_array - name: straight_87bde41b_strai_6490ae29 + name: straight_87bde41b_strai_de27d4c4 default: component: function: straight @@ -161,21 +174,24 @@ settings: get_input_labels_function: function: get_input_labels grating_coupler: - decorator: - - - function: add_ports_from_siepic_pins - - function: remove_pins - - function: add_pins_siepic_of_add_bbox_siepic - padding: -0.001 - - function: add_siepic_labels_and_simulation_info - - angle: 180 - function: rotate function: import_gds - gdsdir: gds - gdspath: ebeam_gc_te1550.gds - model: ebeam_gc_te1550 - opt1: opt_wg - polarization: te - wavelength: 1.55 + settings: + decorator: + - - function: add_ports_from_siepic_pins + - function: remove_pins + - function: add_pins_siepic_of_add_bbox_siepic + settings: + padding: -0.001 + - function: add_siepic_labels_and_simulation_info + - function: rotate + settings: + angle: 180 + gdsdir: gds + gdspath: ebeam_gc_te1550.gds + model: ebeam_gc_te1550 + opt1: opt_wg + polarization: te + wavelength: 1.55 optical_routing_type: 0 with_loopback: false full: @@ -187,26 +203,29 @@ settings: get_input_labels_function: function: get_input_labels grating_coupler: - decorator: - - - function: add_ports_from_siepic_pins - - function: remove_pins - - function: add_pins_siepic_of_add_bbox_siepic - padding: -0.001 - - function: add_siepic_labels_and_simulation_info - - angle: 180 - function: rotate function: import_gds - gdsdir: gds - gdspath: ebeam_gc_te1550.gds - model: ebeam_gc_te1550 - opt1: opt_wg - polarization: te - wavelength: 1.55 + settings: + decorator: + - - function: add_ports_from_siepic_pins + - function: remove_pins + - function: add_pins_siepic_of_add_bbox_siepic + settings: + padding: -0.001 + - function: add_siepic_labels_and_simulation_info + - function: rotate + settings: + angle: 180 + gdsdir: gds + gdspath: ebeam_gc_te1550.gds + model: ebeam_gc_te1550 + opt1: opt_wg + polarization: te + wavelength: 1.55 optical_routing_type: 0 with_loopback: false function_name: add_fiber_array info: {} info_version: 2 module: ubcpdk.components.add_fiber_array - name: straight_87bde41b_strai_feb49d09 + name: straight_87bde41b_strai_9c296313 version: 0.0.1 diff --git a/ubcpdk/tests/test_components/test_pdk_settings_bend_euler_.yml b/ubcpdk/tests/test_components/test_pdk_settings_bend_euler_.yml index 695b0019..4d0f84fa 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_bend_euler_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_bend_euler_.yml @@ -8,15 +8,16 @@ settings: angle: 90 cross_section: function: cross_section + settings: {} direction: ccw npoints: 720 p: 0.5 with_arc_floorplan: true - with_cladding_box: true full: angle: 90 cross_section: function: cross_section + settings: {} decorator: - function: add_bbox_siepic - function: add_pins_siepic @@ -24,7 +25,6 @@ settings: npoints: 720 p: 0.5 with_arc_floorplan: true - with_cladding_box: true function_name: bend_euler info: dy: 10.0 diff --git a/ubcpdk/tests/test_components/test_pdk_settings_coupler_.yml b/ubcpdk/tests/test_components/test_pdk_settings_coupler_.yml new file mode 100644 index 00000000..5fa6f733 --- /dev/null +++ b/ubcpdk/tests/test_components/test_pdk_settings_coupler_.yml @@ -0,0 +1,49 @@ +settings: + changed: + decorator: + - function: add_ports_from_siepic_pins + - function: remove_pins + - function: add_pins_siepic_of_add_bbox_siepic + settings: + padding: -0.001 + - function: add_siepic_labels_and_simulation_info + child: null + default: + coupler_straight: + function: coupler_straight + coupler_symmetric: + function: coupler_symmetric + cross_section: + function: cross_section + settings: {} + dx: 10 + dy: 5 + gap: 0.236 + length: 20 + full: + coupler_straight: + function: coupler_straight + coupler_symmetric: + function: coupler_symmetric + cross_section: + function: cross_section + settings: {} + decorator: + - function: add_ports_from_siepic_pins + - function: remove_pins + - function: add_pins_siepic_of_add_bbox_siepic + settings: + padding: -0.001 + - function: add_siepic_labels_and_simulation_info + dx: 10 + dy: 5 + gap: 0.236 + length: 20 + function_name: coupler + info: + length: 10.314 + min_bend_radius: 9.451 + info_version: 2 + module: gdsfactory.components.coupler + name: coupler_0bf175bc +version: 0.0.1 diff --git a/ubcpdk/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml b/ubcpdk/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml index 18dc7be1..0d2c177c 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_ebeam_dc_te1550_.yml @@ -8,6 +8,7 @@ settings: function: coupler_symmetric cross_section: function: cross_section + settings: {} dx: 10 dy: 5 gap: 0.236 @@ -19,6 +20,7 @@ settings: function: coupler_symmetric cross_section: function: cross_section + settings: {} dx: 10 dy: 5 gap: 0.236 diff --git a/ubcpdk/tests/test_components/test_pdk_settings_mzi_.yml b/ubcpdk/tests/test_components/test_pdk_settings_mzi_.yml index 10c5f3ce..a749bf18 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_mzi_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_mzi_.yml @@ -1,30 +1,32 @@ settings: changed: bend: - decorator: - - function: add_bbox_siepic - - function: add_pins_siepic function: bend_euler + settings: + decorator: + - function: add_bbox_siepic + - function: add_pins_siepic port_e0_combiner: opt3 port_e0_splitter: opt3 port_e1_combiner: opt2 port_e1_splitter: opt2 splitter: - decorator: - - function: add_ports_from_siepic_pins - - function: remove_pins - - - function: add_bbox_siepic - - function: add_pins_siepic - - function: add_siepic_labels_and_simulation_info - doc: Y junction TE1550 50/50 power. function: import_gds - gdsdir: gds - gdspath: ebeam_y_1550.gds - model: ebeam_y_1550 - name: ebeam_y_1550 - opt1: opt_a1 - opt2: opt_b1 - opt3: opt_b2 + settings: + decorator: + - function: add_ports_from_siepic_pins + - function: remove_pins + - - function: add_bbox_siepic + - function: add_pins_siepic + - function: add_siepic_labels_and_simulation_info + doc: Y junction TE1550 50/50 power. + gdsdir: gds + gdspath: ebeam_y_1550.gds + model: ebeam_y_1550 + name: ebeam_y_1550 + opt1: opt_a1 + opt2: opt_b1 + opt3: opt_b2 child: null default: bend: @@ -32,6 +34,7 @@ settings: combiner: null cross_section: function: cross_section + settings: {} delta_length: 10 length_x: 0.1 length_y: 2 @@ -50,13 +53,15 @@ settings: with_splitter: true full: bend: - decorator: - - function: add_bbox_siepic - - function: add_pins_siepic function: bend_euler + settings: + decorator: + - function: add_bbox_siepic + - function: add_pins_siepic combiner: null cross_section: function: cross_section + settings: {} delta_length: 10 length_x: 0.1 length_y: 2 @@ -66,21 +71,22 @@ settings: port_e1_combiner: opt2 port_e1_splitter: opt2 splitter: - decorator: - - function: add_ports_from_siepic_pins - - function: remove_pins - - - function: add_bbox_siepic - - function: add_pins_siepic - - function: add_siepic_labels_and_simulation_info - doc: Y junction TE1550 50/50 power. function: import_gds - gdsdir: gds - gdspath: ebeam_y_1550.gds - model: ebeam_y_1550 - name: ebeam_y_1550 - opt1: opt_a1 - opt2: opt_b1 - opt3: opt_b2 + settings: + decorator: + - function: add_ports_from_siepic_pins + - function: remove_pins + - - function: add_bbox_siepic + - function: add_pins_siepic + - function: add_siepic_labels_and_simulation_info + doc: Y junction TE1550 50/50 power. + gdsdir: gds + gdspath: ebeam_y_1550.gds + model: ebeam_y_1550 + name: ebeam_y_1550 + opt1: opt_a1 + opt2: opt_b1 + opt3: opt_b2 straight: function: straight straight_x_bot: null diff --git a/ubcpdk/tests/test_components/test_pdk_settings_ring_single_.yml b/ubcpdk/tests/test_components/test_pdk_settings_ring_single_.yml index ac01ed3c..b71c7342 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_ring_single_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_ring_single_.yml @@ -8,6 +8,7 @@ settings: function: coupler_ring cross_section: function: cross_section + settings: {} gap: 0.2 length_x: 4 length_y: 0.6 @@ -21,6 +22,7 @@ settings: function: coupler_ring cross_section: function: cross_section + settings: {} gap: 0.2 length_x: 4 length_y: 0.6 diff --git a/ubcpdk/tests/test_components/test_pdk_settings_ring_with_crossing_.yml b/ubcpdk/tests/test_components/test_pdk_settings_ring_with_crossing_.yml index cec0952c..da627c81 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_ring_with_crossing_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_ring_with_crossing_.yml @@ -1,16 +1,17 @@ settings: changed: component: - decorator: - - function: add_ports_from_siepic_pins - - function: remove_pins - - - function: add_bbox_siepic - - function: add_pins_siepic - - function: add_siepic_labels_and_simulation_info - doc: TE waveguide crossing. function: import_gds - gdsdir: gds - gdspath: ebeam_crossing4.gds + settings: + decorator: + - function: add_ports_from_siepic_pins + - function: remove_pins + - - function: add_bbox_siepic + - function: add_pins_siepic + - function: add_siepic_labels_and_simulation_info + doc: TE waveguide crossing. + gdsdir: gds + gdspath: ebeam_crossing4.gds port_name: opt4 child: {} default: @@ -18,7 +19,8 @@ settings: function: bend_euler component: function: taper - width2: 3 + settings: + width2: 3 coupler: function: coupler_ring gap: 0.2 @@ -33,16 +35,17 @@ settings: bend: function: bend_euler component: - decorator: - - function: add_ports_from_siepic_pins - - function: remove_pins - - - function: add_bbox_siepic - - function: add_pins_siepic - - function: add_siepic_labels_and_simulation_info - doc: TE waveguide crossing. function: import_gds - gdsdir: gds - gdspath: ebeam_crossing4.gds + settings: + decorator: + - function: add_ports_from_siepic_pins + - function: remove_pins + - - function: add_bbox_siepic + - function: add_pins_siepic + - function: add_siepic_labels_and_simulation_info + doc: TE waveguide crossing. + gdsdir: gds + gdspath: ebeam_crossing4.gds coupler: function: coupler_ring gap: 0.2 diff --git a/ubcpdk/tests/test_components/test_pdk_settings_spiral_.yml b/ubcpdk/tests/test_components/test_pdk_settings_spiral_.yml index 6f718b23..7137b3fb 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_spiral_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_spiral_.yml @@ -7,6 +7,7 @@ settings: function: bend_euler cross_section: function: cross_section + settings: {} length: null x_inner_length_cutback: 300 x_inner_offset: 0 @@ -19,6 +20,7 @@ settings: function: bend_euler cross_section: function: cross_section + settings: {} length: null x_inner_length_cutback: 300 x_inner_offset: 0 diff --git a/ubcpdk/tests/test_components/test_pdk_settings_straight_.yml b/ubcpdk/tests/test_components/test_pdk_settings_straight_.yml index a5501c71..b62e3da3 100644 --- a/ubcpdk/tests/test_components/test_pdk_settings_straight_.yml +++ b/ubcpdk/tests/test_components/test_pdk_settings_straight_.yml @@ -10,19 +10,19 @@ settings: default: cross_section: function: cross_section + settings: {} length: 10 npoints: 2 - with_cladding_box: true full: cross_section: function: cross_section + settings: {} layer: - 1 - 0 length: 10 npoints: 2 width: 0.5 - with_cladding_box: true function_name: straight info: length: 10.0