diff --git a/Makefile b/Makefile index 6578cfcc94..d7b80ad60f 100644 --- a/Makefile +++ b/Makefile @@ -65,9 +65,6 @@ release: git push git push origin --tags -lintdocs: - flake8 --select RST - autopep8: autopep8 --in-place --aggressive --aggressive **/*.py @@ -80,22 +77,7 @@ docs: git-rm-merged: git branch -D `git branch --merged | grep -v \* | xargs` -constructor: - conda install constructor -y - constructor conda - -notebooks: - jupytext gdsfactory/samples/notebooks/*.md --to ipynb notebooks/ - -jupytext: - jupytext **/*.ipynb --to py - -jupytext-clean: - jupytext docs/**/*.py --to py - notebooks: - # jupytext docs/notebooks/*.py --to ipynb - # jupytext docs/notebooks/*.ipynb --to to - jupytext --pipe black docs/notebooks/*.py + jupytext docs/notebooks/*.py --to ipynb .PHONY: gdsdiff build conda gdslib docs doc diff --git a/gdsfactory/components/coupler_ring.py b/gdsfactory/components/coupler_ring.py index 7d31db00aa..9b6558a477 100644 --- a/gdsfactory/components/coupler_ring.py +++ b/gdsfactory/components/coupler_ring.py @@ -26,6 +26,7 @@ def coupler_ring( cross_section: CrossSectionSpec = "xs_sc", cross_section_bend: CrossSectionSpec | None = None, length_extension: float = 3, + add_bbox: callable | None = None, ) -> Component: r"""Coupler for ring. @@ -103,6 +104,8 @@ def coupler_ring( c.add_ports(cbl.get_ports_list(port_type="electrical"), prefix="cbl") c.add_ports(cbr.get_ports_list(port_type="electrical"), prefix="cbr") c.auto_rename_ports() + if add_bbox: + add_bbox(c) xs.add_pins(c) return c diff --git a/gdsfactory/components/ring_single.py b/gdsfactory/components/ring_single.py index 3fff8bcd2c..c8af4cfc7d 100644 --- a/gdsfactory/components/ring_single.py +++ b/gdsfactory/components/ring_single.py @@ -15,6 +15,8 @@ def ring_single( length_y: float = 0.6, coupler_ring: ComponentFactory = coupler_ring_function, bend: ComponentFactory = bend_euler, + bend_coupler: ComponentFactory | None = bend_euler, + straight: ComponentFactory = straight, cross_section: CrossSectionSpec = "xs_sc", **kwargs, ) -> gf.Component: @@ -49,9 +51,11 @@ def ring_single( radius = radius or xs.radius cross_section = xs.copy(radius=radius, **kwargs) + bend_coupler = bend_coupler or bend + c = gf.Component() cb = c << coupler_ring( - bend=bend, + bend=bend_coupler, gap=gap, radius=radius, length_x=length_x, diff --git a/gdsfactory/components/straight.py b/gdsfactory/components/straight.py index aaa2f7ca2d..c3ed782c16 100644 --- a/gdsfactory/components/straight.py +++ b/gdsfactory/components/straight.py @@ -14,6 +14,7 @@ def straight( width: float | None = None, add_pins: bool = True, cross_section: CrossSectionSpec = "xs_sc", + add_bbox: callable | None = None, ) -> Component: """Returns a Straight waveguide. @@ -41,6 +42,8 @@ def straight( ref = c << path c.add_ports(ref.ports) + if add_bbox: + add_bbox(c) x.add_bbox(c, right=0, left=0) if add_pins: x.add_pins(c) diff --git a/gdsfactory/samples/pdk/test_fab_c/test_settings_straight_nc_.yml b/gdsfactory/samples/pdk/test_fab_c/test_settings_straight_nc_.yml index 85492470bc..436ad00edc 100644 --- a/gdsfactory/samples/pdk/test_fab_c/test_settings_straight_nc_.yml +++ b/gdsfactory/samples/pdk/test_fab_c/test_settings_straight_nc_.yml @@ -63,6 +63,7 @@ settings: width_wide: null child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -70,6 +71,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: add_pins_function_module: gdsfactory.samples.pdk.fab_c diff --git a/test-data-regression/test_netlists_sample_doe_function_.yml b/test-data-regression/test_netlists_sample_doe_function_.yml index 5c2bf06cb5..8d9addc1f9 100644 --- a/test-data-regression/test_netlists_sample_doe_function_.yml +++ b/test-data-regression/test_netlists_sample_doe_function_.yml @@ -33,6 +33,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -40,9 +42,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -50,6 +56,8 @@ instances: length_x: 1 length_y: 0.6 radius: 20 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -128,6 +136,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -135,9 +145,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -145,6 +159,8 @@ instances: length_x: 1 length_y: 0.6 radius: 30 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -223,6 +239,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -230,9 +248,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -240,6 +262,8 @@ instances: length_x: 1 length_y: 0.6 radius: 40 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -318,6 +342,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -325,9 +351,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -335,6 +365,8 @@ instances: length_x: 1 length_y: 0.6 radius: 50 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -413,6 +445,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -420,9 +454,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -430,6 +468,8 @@ instances: length_x: 2 length_y: 0.6 radius: 20 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -508,6 +548,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -515,9 +557,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -525,6 +571,8 @@ instances: length_x: 2 length_y: 0.6 radius: 30 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -603,6 +651,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -610,9 +660,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -620,6 +674,8 @@ instances: length_x: 2 length_y: 0.6 radius: 40 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -698,6 +754,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -705,9 +763,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -715,6 +777,8 @@ instances: length_x: 2 length_y: 0.6 radius: 50 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -793,6 +857,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -800,9 +866,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -810,6 +880,8 @@ instances: length_x: 3 length_y: 0.6 radius: 20 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -888,6 +960,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -895,9 +969,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -905,6 +983,8 @@ instances: length_x: 3 length_y: 0.6 radius: 30 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -983,6 +1063,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -990,9 +1072,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -1000,6 +1086,8 @@ instances: length_x: 3 length_y: 0.6 radius: 40 + straight: + function: straight function_name: ring_single info: {} info_version: 2 @@ -1078,6 +1166,8 @@ instances: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -1085,9 +1175,13 @@ instances: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -1095,6 +1189,8 @@ instances: length_x: 3 length_y: 0.6 radius: 50 + straight: + function: straight function_name: ring_single info: {} info_version: 2 diff --git a/test-data-regression/test_settings_add_grating_couplers_.yml b/test-data-regression/test_settings_add_grating_couplers_.yml index d016338d80..910339c2d2 100644 --- a/test-data-regression/test_settings_add_grating_couplers_.yml +++ b/test-data-regression/test_settings_add_grating_couplers_.yml @@ -6,6 +6,7 @@ settings: changed: {} child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -13,6 +14,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: xs_sc layer: null diff --git a/test-data-regression/test_settings_coupler_ring_.yml b/test-data-regression/test_settings_coupler_ring_.yml index 2cffd1b7b5..4baa1bb640 100644 --- a/test-data-regression/test_settings_coupler_ring_.yml +++ b/test-data-regression/test_settings_coupler_ring_.yml @@ -52,6 +52,7 @@ settings: changed: {} child: null default: + add_bbox: null bend: function: bend_euler coupler90: @@ -65,6 +66,7 @@ settings: length_x: 4.0 radius: 5.0 full: + add_bbox: null bend: function: bend_euler coupler90: diff --git a/test-data-regression/test_settings_ring_single_.yml b/test-data-regression/test_settings_ring_single_.yml index db067f95ca..dbf2fb7168 100644 --- a/test-data-regression/test_settings_ring_single_.yml +++ b/test-data-regression/test_settings_ring_single_.yml @@ -30,6 +30,8 @@ settings: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -37,9 +39,13 @@ settings: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -47,6 +53,8 @@ settings: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight function_name: ring_single info: {} info_version: 2 diff --git a/test-data-regression/test_settings_ring_single_trenches_.yml b/test-data-regression/test_settings_ring_single_trenches_.yml index 215b9c7c2f..fa73804de3 100644 --- a/test-data-regression/test_settings_ring_single_trenches_.yml +++ b/test-data-regression/test_settings_ring_single_trenches_.yml @@ -34,6 +34,8 @@ settings: default: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -41,9 +43,13 @@ settings: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight full: bend: function: bend_euler + bend_coupler: + function: bend_euler coupler_ring: function: coupler_ring cross_section: xs_sc @@ -51,6 +57,8 @@ settings: length_x: 4.0 length_y: 0.6 radius: 10.0 + straight: + function: straight function_name: ring_single info: {} info_version: 2 diff --git a/test-data-regression/test_settings_straight_.yml b/test-data-regression/test_settings_straight_.yml index 90e4b33f5b..b0f0aac9f2 100644 --- a/test-data-regression/test_settings_straight_.yml +++ b/test-data-regression/test_settings_straight_.yml @@ -28,6 +28,7 @@ settings: changed: {} child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -35,6 +36,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: xs_sc layer: null diff --git a/test-data-regression/test_settings_straight_rib_.yml b/test-data-regression/test_settings_straight_rib_.yml index 57de599cdb..7ef8e1383f 100644 --- a/test-data-regression/test_settings_straight_rib_.yml +++ b/test-data-regression/test_settings_straight_rib_.yml @@ -46,6 +46,7 @@ settings: width: 6.0 child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -53,6 +54,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: function: cross_section diff --git a/test-data-regression/test_settings_straight_rib_tapered_.yml b/test-data-regression/test_settings_straight_rib_tapered_.yml index 9d7c07d8e9..8f63e4ad51 100644 --- a/test-data-regression/test_settings_straight_rib_tapered_.yml +++ b/test-data-regression/test_settings_straight_rib_tapered_.yml @@ -73,6 +73,7 @@ settings: width: 6.0 child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -80,6 +81,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: function: cross_section diff --git a/test-data-regression/test_settings_tapers_.yml b/test-data-regression/test_settings_tapers_.yml index cd4e074433..94824d1341 100644 --- a/test-data-regression/test_settings_tapers_.yml +++ b/test-data-regression/test_settings_tapers_.yml @@ -72,6 +72,7 @@ settings: width: 2 child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -79,6 +80,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: xs_sc layer: null diff --git a/test-data-regression/test_settings_wire_straight_.yml b/test-data-regression/test_settings_wire_straight_.yml index c307f0a9b9..e66918b42a 100644 --- a/test-data-regression/test_settings_wire_straight_.yml +++ b/test-data-regression/test_settings_wire_straight_.yml @@ -29,6 +29,7 @@ settings: cross_section: xs_metal_routing child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -36,6 +37,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: xs_metal_routing layer: null diff --git a/tests/gds/straight.yml b/tests/gds/straight.yml index 57afdeaa9b..98c857389c 100644 --- a/tests/gds/straight.yml +++ b/tests/gds/straight.yml @@ -4,6 +4,7 @@ cells: length: 1.234 child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -11,6 +12,7 @@ cells: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -61,6 +63,7 @@ settings: length: 1.234 child: null default: + add_bbox: null add_pins: true cross_section: xs_sc layer: null @@ -68,6 +71,7 @@ settings: npoints: 2 width: null full: + add_bbox: null add_pins: true cross_section: xs_sc layer: null