diff --git a/gdsfactory/component.py b/gdsfactory/component.py index 7ecbdedc94..54f689a57a 100644 --- a/gdsfactory/component.py +++ b/gdsfactory/component.py @@ -55,6 +55,7 @@ from gdsfactory.technology import LayerStack, LayerViews from gdsfactory.typings import ( Coordinate, + CrossSection, CrossSectionSpec, Float2, Layer, @@ -2434,6 +2435,48 @@ def offset( layer=layer, ) + def add_route_info( + self, + cross_section: CrossSection | str, + length: float, + length_eff: float | None = None, + taper: bool = False, + **kwargs, + ) -> None: + """Adds route information to a component. + + Args: + cross_section: CrossSection or name of the cross_section. + length: length of the route. + length_eff: effective length of the route. + taper: if True adds taper information. + **kwargs: extra information to add to the component. + """ + from gdsfactory.pdk import get_active_pdk + + pdk = get_active_pdk() + + length_eff = length_eff or length + xs_name = ( + cross_section + if isinstance(cross_section, str) + else pdk.get_cross_section_name(cross_section) + ) + + d = { + "type": xs_name, + "length": length_eff, + f"{xs_name}_length": length_eff, + "weight": length_eff, + } + if taper: + d[f"{xs_name}_taper_length"] = length + d |= kwargs + self.info["route_info"] = d + + +# Component methods + def copy( D: Component, diff --git a/gdsfactory/components/bend_circular.py b/gdsfactory/components/bend_circular.py index cb167d0a22..b5945404b0 100644 --- a/gdsfactory/components/bend_circular.py +++ b/gdsfactory/components/bend_circular.py @@ -58,6 +58,9 @@ def bend_circular( x.add_bbox(c) if add_pins: x.add_pins(c) + c.add_route_info( + cross_section=x, length=c.info["length"], n_bend_90=abs(angle / 90.0) + ) return c diff --git a/gdsfactory/components/bend_euler.py b/gdsfactory/components/bend_euler.py index 4dddaee79f..21e5c2ca23 100644 --- a/gdsfactory/components/bend_euler.py +++ b/gdsfactory/components/bend_euler.py @@ -89,6 +89,9 @@ def bend_euler( if add_pins: x.add_pins(c) c.absorb(ref) + c.add_route_info( + cross_section=x, length=c.info["length"], n_bend_90=abs(angle / 90.0) + ) return c diff --git a/gdsfactory/components/straight.py b/gdsfactory/components/straight.py index 3cc94fee94..d79ba6beb7 100644 --- a/gdsfactory/components/straight.py +++ b/gdsfactory/components/straight.py @@ -47,6 +47,8 @@ def straight( c.info["length"] = length c.info["width"] = x.sections[0].width c.info["cross_section"] = cross_section + + c.add_route_info(cross_section=x, length=length) c.absorb(ref) return c @@ -56,4 +58,6 @@ def straight( xs = gf.cross_section.strip() c = straight(layer=(2, 0)) + # c = straight() + print(c.info) c.show(show_ports=True) diff --git a/gdsfactory/components/taper_cross_section.py b/gdsfactory/components/taper_cross_section.py index 2a2730effb..009d79efda 100644 --- a/gdsfactory/components/taper_cross_section.py +++ b/gdsfactory/components/taper_cross_section.py @@ -6,7 +6,6 @@ from gdsfactory.cell import cell from gdsfactory.component import Component from gdsfactory.cross_section import strip_rib_tip -from gdsfactory.route_info import route_info from gdsfactory.typings import CrossSectionSpec @@ -59,7 +58,7 @@ def taper_cross_section( c.add_ports(ref.ports) c.absorb(ref) if "type" in x1.info and x1.info["type"] == x2.info.get("type"): - c.info["route_info"] = route_info(x1.info["type"], length=length, taper=True) + c.add_route_info(cross_section=x1, length=length, taper=True) return c diff --git a/gdsfactory/cross_section.py b/gdsfactory/cross_section.py index f31e0e9153..336ead02e5 100644 --- a/gdsfactory/cross_section.py +++ b/gdsfactory/cross_section.py @@ -287,7 +287,7 @@ def add_bbox( c.add_polygon(points, layer=layer) return c - def get_xmin_xmax(self): + def get_xmin_xmax(self) -> tuple[float, float]: """Returns the min and max extent of the cross_section across all sections.""" main_width = self.width main_offset = self.sections[0].offset diff --git a/gdsfactory/pdk.py b/gdsfactory/pdk.py index ddb5cfcda4..a1a7c58fbb 100644 --- a/gdsfactory/pdk.py +++ b/gdsfactory/pdk.py @@ -686,6 +686,17 @@ def to_updk(self) -> str: # def on_cross_section_registered(self) -> Event: # return self._on_cross_section_registered + def get_cross_section_name(self, cross_section: CrossSection) -> str: + xs_name = next( + ( + key + for key, value in self.cross_sections.items() + if value == cross_section + ), + None, + ) + return xs_name or cross_section.name + _ACTIVE_PDK = None diff --git a/gdsfactory/route_info.py b/gdsfactory/route_info.py deleted file mode 100644 index f0af804c9f..0000000000 --- a/gdsfactory/route_info.py +++ /dev/null @@ -1,57 +0,0 @@ -from gdsfactory.serialization import clean_value_json -from gdsfactory.typings import CrossSectionSpec - - -def route_info( - cs_type: str, - length: float, - length_eff: float | None = None, - taper: bool = False, - **kwargs, -) -> dict[str, float | str]: - """Returns route info dict for pathlength analysis. - - Args: - cs_type: cross section type. - length: length. - length_eff: effective length (i.e. an equivalent straight length of a bend). - taper: True if this component is a taper. - kwargs: other attributes to track. - - Returns: - A dictionary of routing attributes. - """ - if length_eff is None: - length_eff = length - - d = { - "type": clean_value_json(cs_type), - "length": length_eff, - f"{cs_type}_length": length_eff, - "weight": length_eff, - } - if taper: - d[f"{cs_type}_taper_length"] = length - d |= kwargs - return d - - -def route_info_from_cs( - cs: CrossSectionSpec, length: float, length_eff: float | None = None, **kwargs -) -> dict[str, float | str]: - """Returns route info dict for pathlength analysis. - - Args: - cs: cross section object or spec. - length: length. - length_eff: effective length (i.e. an equivalent straight length of a bend). - kwargs: other attributes to track. - - Returns: - A dictionary of routing attributes. - """ - from gdsfactory import get_cross_section - - x = get_cross_section(cs) - cs_type = x.info.get("type", clean_value_json(cs)) - return route_info(cs_type, length=length, length_eff=length_eff, **kwargs) diff --git a/gdsfactory/samples/pdk/test_fab_c/test_settings_bend_euler_nc_.yml b/gdsfactory/samples/pdk/test_fab_c/test_settings_bend_euler_nc_.yml index 3c6d077a7a..711a110ab9 100644 --- a/gdsfactory/samples/pdk/test_fab_c/test_settings_bend_euler_nc_.yml +++ b/gdsfactory/samples/pdk/test_fab_c/test_settings_bend_euler_nc_.yml @@ -124,6 +124,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_e757d4e7 + weight: 16.637 + xs_e757d4e7_length: 16.637 width: 1.0 info_version: 2 module: gdsfactory.components.bend_euler 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 db0cda42a0..c1105436a8 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 @@ -148,6 +148,11 @@ settings: taper_length: 10.0 width_wide: null length: 10.0 + route_info: + length: 10.0 + type: xs_e757d4e7 + weight: 10.0 + xs_e757d4e7_length: 10.0 width: 1.0 info_version: 2 module: gdsfactory.components.straight diff --git a/gdsfactory/serialization.py b/gdsfactory/serialization.py index 8c2f9b2ec7..aa64f1fc4c 100644 --- a/gdsfactory/serialization.py +++ b/gdsfactory/serialization.py @@ -6,7 +6,6 @@ import inspect import pathlib from collections.abc import KeysView as dict_keys -from functools import partial from typing import Any import gdstk @@ -72,22 +71,7 @@ def clean_value_json(value: Any) -> str | int | float | dict | list | bool | Non return orjson.loads(orjson.dumps(value, option=orjson.OPT_SERIALIZE_NUMPY)) elif callable(value) and isinstance(value, functools.partial): - sig = inspect.signature(value.func) - args_as_kwargs = dict(zip(sig.parameters.keys(), value.args)) - args_as_kwargs.update(value.keywords) - args_as_kwargs = clean_dict(args_as_kwargs) - - func = value.func - while hasattr(func, "func"): - func = func.func - v = { - "function": func.__name__, - "settings": args_as_kwargs, - } - if include_module: - v.update(module=func.__module__) - return v - + return clean_value_partial(value, include_module) elif hasattr(value, "to_dict"): return clean_dict(value.to_dict()) @@ -132,6 +116,24 @@ def clean_value_json(value: Any) -> str | int | float | dict | list | bool | Non raise e +def clean_value_partial(value, include_module): + sig = inspect.signature(value.func) + args_as_kwargs = dict(zip(sig.parameters.keys(), value.args)) + args_as_kwargs |= value.keywords + args_as_kwargs = clean_dict(args_as_kwargs) + + func = value.func + while hasattr(func, "func"): + func = func.func + v = { + "function": func.__name__, + "settings": args_as_kwargs, + } + if include_module: + v.update(module=func.__module__) + return v + + def clean_value_name(value: Any) -> str: """Returns a string representation of an object.""" # value1 = clean_value_json(value) @@ -153,13 +155,13 @@ def get_hash(value: Any) -> str: # d = clean_value_json(c) # print(d, d) - xs = partial( - gf.cross_section.strip, - width=3, - add_pins=gf.partial(gf.add_pins.add_pins_inside1nm, pin_length=0.1), - ) - f = partial(gf.routing.add_fiber_array, cross_section=xs) - c = f() + # xs = partial( + # gf.cross_section.strip, + # width=3, + # add_pins=gf.partial(gf.add_pins.add_pins_inside1nm, pin_length=0.1), + # ) + # f = partial(gf.routing.add_fiber_array, cross_section=xs) + # c = f() + c = gf.cross_section.strip(width=3) d = clean_value_json(c) print(get_hash(d)) - print(d, d) diff --git a/test-data-regression/test_netlists_mzit_.yml b/test-data-regression/test_netlists_mzit_.yml index 9b9b5ddd47..f56018d465 100644 --- a/test-data-regression/test_netlists_mzit_.yml +++ b/test-data-regression/test_netlists_mzit_.yml @@ -24,6 +24,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_15379035 + weight: 16.637 + xs_15379035_length: 16.637 width: 0.45 settings: cross_section: @@ -63,6 +69,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_15379035 + weight: 16.637 + xs_15379035_length: 16.637 width: 0.45 settings: cross_section: @@ -102,6 +114,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_fb9acbc2 + weight: 16.637 + xs_fb9acbc2_length: 16.637 width: 0.55 settings: cross_section: @@ -141,6 +159,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_fb9acbc2 + weight: 16.637 + xs_fb9acbc2_length: 16.637 width: 0.55 settings: cross_section: @@ -225,6 +249,11 @@ instances: taper_length: 10.0 width_wide: null length: 1.0 + route_info: + length: 1.0 + type: xs_fb9acbc2 + weight: 1.0 + xs_fb9acbc2_length: 1.0 width: 0.55 settings: cross_section: @@ -292,6 +321,11 @@ instances: taper_length: 10.0 width_wide: null length: 3.0 + route_info: + length: 3.0 + type: xs_fb9acbc2 + weight: 3.0 + xs_fb9acbc2_length: 3.0 width: 0.55 settings: cross_section: @@ -359,6 +393,11 @@ instances: taper_length: 10.0 width_wide: null length: 4.0 + route_info: + length: 4.0 + type: xs_fb9acbc2 + weight: 4.0 + xs_fb9acbc2_length: 4.0 width: 0.55 settings: cross_section: @@ -426,6 +465,11 @@ instances: taper_length: 10.0 width_wide: null length: 3.0 + route_info: + length: 3.0 + type: xs_fb9acbc2 + weight: 3.0 + xs_fb9acbc2_length: 3.0 width: 0.55 settings: cross_section: @@ -493,6 +537,11 @@ instances: taper_length: 10.0 width_wide: null length: 1.0 + route_info: + length: 1.0 + type: xs_15379035 + weight: 1.0 + xs_15379035_length: 1.0 width: 0.45 settings: cross_section: diff --git a/test-data-regression/test_netlists_ring_double_.yml b/test-data-regression/test_netlists_ring_double_.yml index 8aff40fced..1563084eae 100644 --- a/test-data-regression/test_netlists_ring_double_.yml +++ b/test-data-regression/test_netlists_ring_double_.yml @@ -108,6 +108,11 @@ instances: taper_length: 10.0 width_wide: null length: 0.01 + route_info: + length: 0.01 + type: xs_sc + weight: 0.01 + xs_sc_length: 0.01 width: 0.5 settings: cross_section: @@ -175,6 +180,11 @@ instances: taper_length: 10.0 width_wide: null length: 0.01 + route_info: + length: 0.01 + type: xs_sc + weight: 0.01 + xs_sc_length: 0.01 width: 0.5 settings: cross_section: diff --git a/test-data-regression/test_netlists_ring_single_.yml b/test-data-regression/test_netlists_ring_single_.yml index 4954156e17..c872cf6a22 100644 --- a/test-data-regression/test_netlists_ring_single_.yml +++ b/test-data-regression/test_netlists_ring_single_.yml @@ -13,6 +13,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -52,6 +58,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -152,6 +164,11 @@ instances: taper_length: 10.0 width_wide: null length: 0.6 + route_info: + length: 0.6 + type: xs_sc + weight: 0.6 + xs_sc_length: 0.6 width: 0.5 settings: cross_section: @@ -219,6 +236,11 @@ instances: taper_length: 10.0 width_wide: null length: 0.6 + route_info: + length: 0.6 + type: xs_sc + weight: 0.6 + xs_sc_length: 0.6 width: 0.5 settings: cross_section: @@ -286,6 +308,11 @@ instances: taper_length: 10.0 width_wide: null length: 4.0 + route_info: + length: 4.0 + type: xs_sc + weight: 4.0 + xs_sc_length: 4.0 width: 0.5 settings: cross_section: diff --git a/test-data-regression/test_netlists_ring_single_array_.yml b/test-data-regression/test_netlists_ring_single_array_.yml index a9cd7be2bb..5b9b9dfb35 100644 --- a/test-data-regression/test_netlists_ring_single_array_.yml +++ b/test-data-regression/test_netlists_ring_single_array_.yml @@ -16,6 +16,11 @@ instances: info: cross_section: xs_sc length: 5.0 + route_info: + length: 5.0 + type: xs_sc + weight: 5.0 + xs_sc_length: 5.0 width: 0.5 settings: length: 5.0 diff --git a/test-data-regression/test_netlists_sample_connections_.yml b/test-data-regression/test_netlists_sample_connections_.yml index 24c15926ec..dda48e00ce 100644 --- a/test-data-regression/test_netlists_sample_connections_.yml +++ b/test-data-regression/test_netlists_sample_connections_.yml @@ -6,6 +6,11 @@ instances: info: cross_section: xs_sc length: 0.5 + route_info: + length: 0.5 + type: xs_sc + weight: 0.5 + xs_sc_length: 0.5 width: 0.5 settings: length: 0.5 @@ -14,6 +19,11 @@ instances: info: cross_section: xs_sc length: 1.0 + route_info: + length: 1.0 + type: xs_sc + weight: 1.0 + xs_sc_length: 1.0 width: 0.5 settings: length: 1 diff --git a/test-data-regression/test_netlists_sample_different_link_factory_.yml b/test-data-regression/test_netlists_sample_different_link_factory_.yml index 70edb1229a..60d847fd5f 100644 --- a/test-data-regression/test_netlists_sample_different_link_factory_.yml +++ b/test-data-regression/test_netlists_sample_different_link_factory_.yml @@ -27,6 +27,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -66,6 +72,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -105,6 +117,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -144,6 +162,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -183,6 +207,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -222,6 +252,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -261,6 +297,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -300,6 +342,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -339,6 +387,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -378,6 +432,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -417,6 +477,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -456,6 +522,12 @@ instances: length: 16.637 radius: 10 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -542,6 +614,11 @@ instances: taper_length: 10.0 width_wide: null length: 200.0 + route_info: + length: 200.0 + type: xs_sc + weight: 200.0 + xs_sc_length: 200.0 width: 0.5 settings: cross_section: @@ -609,6 +686,11 @@ instances: taper_length: 10.0 width_wide: null length: 610.0 + route_info: + length: 610.0 + type: xs_sc + weight: 610.0 + xs_sc_length: 610.0 width: 0.5 settings: cross_section: @@ -676,6 +758,11 @@ instances: taper_length: 10.0 width_wide: null length: 340.0 + route_info: + length: 340.0 + type: xs_sc + weight: 340.0 + xs_sc_length: 340.0 width: 0.5 settings: cross_section: @@ -743,6 +830,11 @@ instances: taper_length: 10.0 width_wide: null length: 250.0 + route_info: + length: 250.0 + type: xs_sc + weight: 250.0 + xs_sc_length: 250.0 width: 0.5 settings: cross_section: @@ -810,6 +902,11 @@ instances: taper_length: 10.0 width_wide: null length: 250.0 + route_info: + length: 250.0 + type: xs_sc + weight: 250.0 + xs_sc_length: 250.0 width: 0.5 settings: cross_section: @@ -877,6 +974,11 @@ instances: taper_length: 10.0 width_wide: null length: 580.0 + route_info: + length: 580.0 + type: xs_sc + weight: 580.0 + xs_sc_length: 580.0 width: 0.5 settings: cross_section: @@ -944,6 +1046,11 @@ instances: taper_length: 10.0 width_wide: null length: 170.0 + route_info: + length: 170.0 + type: xs_sc + weight: 170.0 + xs_sc_length: 170.0 width: 0.5 settings: cross_section: @@ -1011,6 +1118,11 @@ instances: taper_length: 10.0 width_wide: null length: 340.0 + route_info: + length: 340.0 + type: xs_sc + weight: 340.0 + xs_sc_length: 340.0 width: 0.5 settings: cross_section: @@ -1078,6 +1190,11 @@ instances: taper_length: 10.0 width_wide: null length: 250.0 + route_info: + length: 250.0 + type: xs_sc + weight: 250.0 + xs_sc_length: 250.0 width: 0.5 settings: cross_section: @@ -1145,6 +1262,11 @@ instances: taper_length: 10.0 width_wide: null length: 250.0 + route_info: + length: 250.0 + type: xs_sc + weight: 250.0 + xs_sc_length: 250.0 width: 0.5 settings: cross_section: diff --git a/test-data-regression/test_netlists_sample_docstring_.yml b/test-data-regression/test_netlists_sample_docstring_.yml index deb100c7b4..7345efce9f 100644 --- a/test-data-regression/test_netlists_sample_docstring_.yml +++ b/test-data-regression/test_netlists_sample_docstring_.yml @@ -13,6 +13,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -52,6 +58,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -128,6 +140,11 @@ instances: taper_length: 10.0 width_wide: null length: 19.99 + route_info: + length: 19.99 + type: xs_sc + weight: 19.99 + xs_sc_length: 19.99 width: 0.5 settings: cross_section: @@ -195,6 +212,11 @@ instances: taper_length: 10.0 width_wide: null length: 18.75 + route_info: + length: 18.75 + type: xs_sc + weight: 18.75 + xs_sc_length: 18.75 width: 0.5 settings: cross_section: @@ -262,6 +284,11 @@ instances: taper_length: 10.0 width_wide: null length: 0.01 + route_info: + length: 0.01 + type: xs_sc + weight: 0.01 + xs_sc_length: 0.01 width: 0.5 settings: cross_section: diff --git a/test-data-regression/test_netlists_sample_mirror_simple_.yml b/test-data-regression/test_netlists_sample_mirror_simple_.yml index 071d3c7140..16458e5718 100644 --- a/test-data-regression/test_netlists_sample_mirror_simple_.yml +++ b/test-data-regression/test_netlists_sample_mirror_simple_.yml @@ -7,12 +7,23 @@ instances: dy: 10.0 length: 15.708 radius: 10.0 + route_info: + length: 15.708 + n_bend_90: 1.0 + type: xs_sc + weight: 15.708 + xs_sc_length: 15.708 settings: {} s: component: straight info: cross_section: xs_sc length: 10.0 + route_info: + length: 10.0 + type: xs_sc + weight: 10.0 + xs_sc_length: 10.0 width: 0.5 settings: {} name: sample_mirror_simple_0e62769d diff --git a/test-data-regression/test_netlists_sample_mmis_.yml b/test-data-regression/test_netlists_sample_mmis_.yml index 50d258a7c6..1f08f3e8f9 100644 --- a/test-data-regression/test_netlists_sample_mmis_.yml +++ b/test-data-regression/test_netlists_sample_mmis_.yml @@ -13,6 +13,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -52,6 +58,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -128,6 +140,11 @@ instances: taper_length: 10.0 width_wide: null length: 95.02 + route_info: + length: 95.02 + type: xs_sc + weight: 95.02 + xs_sc_length: 95.02 width: 0.5 settings: cross_section: @@ -195,6 +212,11 @@ instances: taper_length: 10.0 width_wide: null length: 79.375 + route_info: + length: 79.375 + type: xs_sc + weight: 79.375 + xs_sc_length: 79.375 width: 0.5 settings: cross_section: @@ -262,6 +284,11 @@ instances: taper_length: 10.0 width_wide: null length: 0.02 + route_info: + length: 0.02 + type: xs_sc + weight: 0.02 + xs_sc_length: 0.02 width: 0.5 settings: cross_section: diff --git a/test-data-regression/test_netlists_sample_waypoints_.yml b/test-data-regression/test_netlists_sample_waypoints_.yml index 615bc1f482..654c87823f 100644 --- a/test-data-regression/test_netlists_sample_waypoints_.yml +++ b/test-data-regression/test_netlists_sample_waypoints_.yml @@ -31,6 +31,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -70,6 +76,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -109,6 +121,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -148,6 +166,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -187,6 +211,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -226,6 +256,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -265,6 +301,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -304,6 +346,12 @@ instances: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 settings: cross_section: @@ -370,6 +418,11 @@ instances: taper_length: 10.0 width_wide: null length: 290.0 + route_info: + length: 290.0 + type: xs_sc + weight: 290.0 + xs_sc_length: 290.0 width: 0.5 settings: cross_section: @@ -437,6 +490,11 @@ instances: taper_length: 10.0 width_wide: null length: 440.0 + route_info: + length: 440.0 + type: xs_sc + weight: 440.0 + xs_sc_length: 440.0 width: 0.5 settings: cross_section: @@ -504,6 +562,11 @@ instances: taper_length: 10.0 width_wide: null length: 380.0 + route_info: + length: 380.0 + type: xs_sc + weight: 380.0 + xs_sc_length: 380.0 width: 0.5 settings: cross_section: @@ -571,6 +634,11 @@ instances: taper_length: 10.0 width_wide: null length: 80.0 + route_info: + length: 80.0 + type: xs_sc + weight: 80.0 + xs_sc_length: 80.0 width: 0.5 settings: cross_section: @@ -638,6 +706,11 @@ instances: taper_length: 10.0 width_wide: null length: 630.0 + route_info: + length: 630.0 + type: xs_sc + weight: 630.0 + xs_sc_length: 630.0 width: 0.5 settings: cross_section: @@ -705,6 +778,11 @@ instances: taper_length: 10.0 width_wide: null length: 590.0 + route_info: + length: 590.0 + type: xs_sc + weight: 590.0 + xs_sc_length: 590.0 width: 0.5 settings: cross_section: @@ -772,6 +850,11 @@ instances: taper_length: 10.0 width_wide: null length: 140.0 + route_info: + length: 140.0 + type: xs_sc + weight: 140.0 + xs_sc_length: 140.0 width: 0.5 settings: cross_section: @@ -839,6 +922,11 @@ instances: taper_length: 10.0 width_wide: null length: 380.0 + route_info: + length: 380.0 + type: xs_sc + weight: 380.0 + xs_sc_length: 380.0 width: 0.5 settings: cross_section: @@ -906,6 +994,11 @@ instances: taper_length: 10.0 width_wide: null length: 380.0 + route_info: + length: 380.0 + type: xs_sc + weight: 380.0 + xs_sc_length: 380.0 width: 0.5 settings: cross_section: @@ -973,6 +1066,11 @@ instances: taper_length: 10.0 width_wide: null length: 630.0 + route_info: + length: 630.0 + type: xs_sc + weight: 630.0 + xs_sc_length: 630.0 width: 0.5 settings: cross_section: diff --git a/test-data-regression/test_settings.yml b/test-data-regression/test_settings.yml index 4f5828b5ff..82eb9679b8 100644 --- a/test-data-regression/test_settings.yml +++ b/test-data-regression/test_settings.yml @@ -44,6 +44,11 @@ settings: settings: add_pins_function_name: add_pins_inside1nm length: 10.0 + route_info: + length: 10.0 + type: xs_sc + weight: 10.0 + xs_sc_length: 10.0 width: 0.5 info_version: 2 module: test_serialize diff --git a/test-data-regression/test_settings_add_grating_couplers_.yml b/test-data-regression/test_settings_add_grating_couplers_.yml index b2adb35c3b..d016338d80 100644 --- a/test-data-regression/test_settings_add_grating_couplers_.yml +++ b/test-data-regression/test_settings_add_grating_couplers_.yml @@ -23,6 +23,11 @@ settings: info: cross_section: xs_sc length: 10.0 + route_info: + length: 10.0 + type: xs_sc + weight: 10.0 + xs_sc_length: 10.0 width: 0.5 info_version: 2 module: gdsfactory.components.straight @@ -66,6 +71,11 @@ settings: cross_section: xs_sc length: 10.0 polarization: te + route_info: + length: 10.0 + type: xs_sc + weight: 10.0 + xs_sc_length: 10.0 wavelength: 1.53 width: 0.5 info_version: 2 diff --git a/test-data-regression/test_settings_add_trenches90_.yml b/test-data-regression/test_settings_add_trenches90_.yml index 72a05c02b2..d576845ba6 100644 --- a/test-data-regression/test_settings_add_trenches90_.yml +++ b/test-data-regression/test_settings_add_trenches90_.yml @@ -61,6 +61,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 info_version: 2 module: gdsfactory.components.bend_euler @@ -87,6 +93,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 info_version: 2 module: gdsfactory.components.add_trenches diff --git a/test-data-regression/test_settings_bend_circular180_.yml b/test-data-regression/test_settings_bend_circular180_.yml index ce9bb2416d..7dcca11681 100644 --- a/test-data-regression/test_settings_bend_circular180_.yml +++ b/test-data-regression/test_settings_bend_circular180_.yml @@ -49,6 +49,12 @@ settings: dy: 0.0 length: 31.415 radius: 10.0 + route_info: + length: 31.415 + n_bend_90: 2.0 + type: xs_sc + weight: 31.415 + xs_sc_length: 31.415 info_version: 2 module: gdsfactory.components.bend_circular name: bend_circular_angle180 diff --git a/test-data-regression/test_settings_bend_circular_.yml b/test-data-regression/test_settings_bend_circular_.yml index 15687b0814..6bd7b96723 100644 --- a/test-data-regression/test_settings_bend_circular_.yml +++ b/test-data-regression/test_settings_bend_circular_.yml @@ -48,6 +48,12 @@ settings: dy: 10.0 length: 15.708 radius: 10.0 + route_info: + length: 15.708 + n_bend_90: 1.0 + type: xs_sc + weight: 15.708 + xs_sc_length: 15.708 info_version: 2 module: gdsfactory.components.bend_circular name: bend_circular diff --git a/test-data-regression/test_settings_bend_euler180_.yml b/test-data-regression/test_settings_bend_euler180_.yml index fafa46d205..376188ec16 100644 --- a/test-data-regression/test_settings_bend_euler180_.yml +++ b/test-data-regression/test_settings_bend_euler180_.yml @@ -56,6 +56,12 @@ settings: length: 42.817 radius: 10.0 radius_min: 9.086 + route_info: + length: 42.817 + n_bend_90: 2.0 + type: xs_sc + weight: 42.817 + xs_sc_length: 42.817 width: 0.5 info_version: 2 module: gdsfactory.components.bend_euler diff --git a/test-data-regression/test_settings_bend_euler_.yml b/test-data-regression/test_settings_bend_euler_.yml index 9f196ab33c..9dfb6b02c7 100644 --- a/test-data-regression/test_settings_bend_euler_.yml +++ b/test-data-regression/test_settings_bend_euler_.yml @@ -55,6 +55,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 info_version: 2 module: gdsfactory.components.bend_euler diff --git a/test-data-regression/test_settings_bend_euler_trenches_.yml b/test-data-regression/test_settings_bend_euler_trenches_.yml index 72a05c02b2..d576845ba6 100644 --- a/test-data-regression/test_settings_bend_euler_trenches_.yml +++ b/test-data-regression/test_settings_bend_euler_trenches_.yml @@ -61,6 +61,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 info_version: 2 module: gdsfactory.components.bend_euler @@ -87,6 +93,12 @@ settings: length: 16.637 radius: 10.0 radius_min: 7.061 + route_info: + length: 16.637 + n_bend_90: 1.0 + type: xs_sc + weight: 16.637 + xs_sc_length: 16.637 width: 0.5 info_version: 2 module: gdsfactory.components.add_trenches diff --git a/test-data-regression/test_settings_straight_.yml b/test-data-regression/test_settings_straight_.yml index b8d6854887..90e4b33f5b 100644 --- a/test-data-regression/test_settings_straight_.yml +++ b/test-data-regression/test_settings_straight_.yml @@ -45,6 +45,11 @@ settings: info: cross_section: xs_sc length: 10.0 + route_info: + length: 10.0 + type: xs_sc + weight: 10.0 + xs_sc_length: 10.0 width: 0.5 info_version: 2 module: gdsfactory.components.straight diff --git a/test-data-regression/test_settings_straight_rib_.yml b/test-data-regression/test_settings_straight_rib_.yml index 827dbd87bc..20188f4248 100644 --- a/test-data-regression/test_settings_straight_rib_.yml +++ b/test-data-regression/test_settings_straight_rib_.yml @@ -97,6 +97,11 @@ settings: simplify: 0.05 width: 6.0 length: 10.0 + route_info: + length: 10.0 + type: xs_2ba84833 + weight: 10.0 + xs_2ba84833_length: 10.0 width: 0.5 info_version: 2 module: gdsfactory.components.straight diff --git a/test-data-regression/test_settings_straight_rib_tapered_.yml b/test-data-regression/test_settings_straight_rib_tapered_.yml index 880a84f02e..29f012ae7f 100644 --- a/test-data-regression/test_settings_straight_rib_tapered_.yml +++ b/test-data-regression/test_settings_straight_rib_tapered_.yml @@ -124,6 +124,11 @@ settings: simplify: 0.05 width: 6.0 length: 10.0 + route_info: + length: 10.0 + type: xs_2ba84833 + weight: 10.0 + xs_2ba84833_length: 10.0 width: 0.5 info_version: 2 module: gdsfactory.components.straight @@ -193,6 +198,11 @@ settings: simplify: 0.05 width: 6.0 length: 10.0 + route_info: + length: 10.0 + type: xs_2ba84833 + weight: 10.0 + xs_2ba84833_length: 10.0 width: 0.5 info_version: 2 module: gdsfactory.components.extension diff --git a/test-data-regression/test_settings_tapers_.yml b/test-data-regression/test_settings_tapers_.yml index 0d60f97686..566422b53b 100644 --- a/test-data-regression/test_settings_tapers_.yml +++ b/test-data-regression/test_settings_tapers_.yml @@ -89,6 +89,11 @@ settings: info: cross_section: xs_sc length: 20.0 + route_info: + length: 20.0 + type: xs_6a91b928 + weight: 20.0 + xs_6a91b928_length: 20.0 width: 2.0 info_version: 2 module: gdsfactory.components.straight @@ -122,6 +127,11 @@ settings: info: cross_section: xs_sc length: 20.0 + route_info: + length: 20.0 + type: xs_6a91b928 + weight: 20.0 + xs_6a91b928_length: 20.0 width: 2.0 info_version: 2 module: gdsfactory.add_tapers @@ -185,6 +195,11 @@ settings: polarization: te wavelength: 1.53 length: 20.0 + route_info: + length: 20.0 + type: xs_6a91b928 + weight: 20.0 + xs_6a91b928_length: 20.0 width: 2.0 info_version: 2 module: gdsfactory.routing.add_fiber_array diff --git a/test-data-regression/test_settings_wire_straight_.yml b/test-data-regression/test_settings_wire_straight_.yml index 40504f4869..c307f0a9b9 100644 --- a/test-data-regression/test_settings_wire_straight_.yml +++ b/test-data-regression/test_settings_wire_straight_.yml @@ -46,6 +46,11 @@ settings: info: cross_section: xs_metal_routing length: 10.0 + route_info: + length: 10.0 + type: xs_m3 + weight: 10.0 + xs_m3_length: 10.0 width: 10.0 info_version: 2 module: gdsfactory.components.straight diff --git a/tests/gds/straight.yml b/tests/gds/straight.yml index b752450af5..57afdeaa9b 100644 --- a/tests/gds/straight.yml +++ b/tests/gds/straight.yml @@ -21,6 +21,11 @@ cells: info: cross_section: xs_sc length: 1.234 + route_info: + length: 1.234 + type: xs_sc + weight: 1.234 + xs_sc_length: 1.234 width: 0.5 info_version: 2 module: gdsfactory.components.straight @@ -73,6 +78,11 @@ settings: info: cross_section: xs_sc length: 1.234 + route_info: + length: 1.234 + type: xs_sc + weight: 1.234 + xs_sc_length: 1.234 width: 0.5 info_version: 2 module: gdsfactory.components.straight