| ERROR | kfactory.kcell:wrapper_autocell:4229 - An error has been caught in function 'wrapper_autocell', process 'MainProcess' (10828), thread 'MainThread' (3128): Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel_launcher.py", line 17, in app.launch_new_instance() │ └ > └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\traitlets\config\application.py", line 1075, in launch_instance app.start() │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel\kernelapp.py", line 701, in start self.io_loop.start() │ │ └ │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\tornado\platform\asyncio.py", line 205, in start self.asyncio_loop.run_forever() │ │ └ │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\asyncio\base_events.py", line 608, in run_forever self._run_once() │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\asyncio\base_events.py", line 1936, in _run_once handle._run() │ └ , ...],))>)> File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\asyncio\events.py", line 84, in _run self._context.run(self._callback, *self._args) │ │ │ │ │ └ │ │ │ │ └ , ...],))>)> │ │ │ └ │ │ └ , ...],))>)> │ └ , ...],))>)> File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel\kernelbase.py", line 534, in dispatch_queue await self.process_one() │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel\kernelbase.py", line 523, in process_one await dispatch(*args) │ └ ([, , > File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel\kernelbase.py", line 429, in dispatch_shell await result └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel\kernelbase.py", line 767, in execute_request reply_content = await reply_content └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel\ipkernel.py", line 429, in do_execute res = shell.run_cell( │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\ipykernel\zmqshell.py", line 549, in run_cell return super().run_cell(*args, **kwargs) │ └ {'store_history': True, 'silent': False, 'cell_id': '1a1334af-8e24-48e7-875b-defeceddd685'} └ ('sim.write_sparameters_lumerical(\n component=c, layer_stack=layer_stack2, run=False, session=session\n)',) File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\IPython\core\interactiveshell.py", line 3075, in run_cell result = self._run_cell( │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\IPython\core\interactiveshell.py", line 3130, in _run_cell result = runner(coro) │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\IPython\core\async_helpers.py", line 129, in _pseudo_sync_runner coro.send(None) │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\IPython\core\interactiveshell.py", line 3334, in run_cell_async has_raised = await self.run_ast_nodes(code_ast.body, cell_name, │ │ │ │ └ 'C:\\Users\\noelleke\\AppData\\Local\\Temp\\ipykernel_10828\\1189059541.py' │ │ │ └ [] │ │ └ │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\IPython\core\interactiveshell.py", line 3517, in run_ast_nodes if await self.run_code(code, result, async_=asy): │ │ │ │ └ False │ │ │ └ at 0x00000217465B2F10, file "C:\Users\noelleke\AppData\Local\Temp\ipykernel_10828\1189059541.py", line 1> │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\IPython\core\interactiveshell.py", line 3577, in run_code exec(code_obj, self.user_global_ns, self.user_ns) │ │ │ │ └ {'__name__': '__main__', '__doc__': 'Automatically created module for IPython interactive environment', '__package__': None, ... │ │ │ └ │ │ └ │ └ at 0x00000217465B2F10, file "C:\Users\noelleke\AppData\Local\Temp\ipykernel_10828\1189059541.py", line 1> File "C:\Users\noelleke\AppData\Local\Temp\ipykernel_10828\1189059541.py", line 1, in sim.write_sparameters_lumerical( │ └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\gplugins\lumerical\write_sparameters_lumerical.py", line 241, in write_sparameters_lumerical component_extended_beyond_pml = gf.components.extension.extend_ports( │ │ │ └ │ │ └ > File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\kfactory\kcell.py", line 4229, in wrapper_autocell _cell = wrapped_cell(**params) │ └ {'component': extend_ports_CUnnamed_2_ed955158: ports ['o1', 'o2', 'o3'], 4 instances, 'port_names': None, 'length': 5.0, 'ex... └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\cachetools\__init__.py", line 752, in wrapper v = func(*args, **kwargs) │ │ └ {'component': extend_ports_CUnnamed_2_ed955158: ports ['o1', 'o2', 'o3'], 4 instances, 'port_names': None, 'length': 5.0, 'ex... │ └ () └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\kfactory\kcell.py", line 4081, in wrapped_cell cell = f(**params) │ └ {'component': extend_ports_CUnnamed_2_ed955158: ports ['o1', 'o2', 'o3'], 4 instances, 'port_names': None, 'length': 5.0, 'ex... └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\gdsfactory\components\extension.py", line 129, in extend_ports cross_section_extension = cross_section or cross_section_function( │ └ └ None File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\gdsfactory\cross_section.py", line 573, in cross_section Section( └ File "C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\pydantic\main.py", line 193, in __init__ self.__pydantic_validator__.validate_python(data, self_instance=self) │ │ │ │ └ Section() │ │ │ └ {'width': 0.5, 'offset': 0, 'layer': 1, 'port_names': ('o1', 'o2'), 'port_types': ('optical', 'optical'), 'name': '_default'} │ │ └ │ └ SchemaValidator(title="Section", validator=Model( │ ModelValidator { │ revalidate: Never, │ validator: Function... └ Section() pydantic_core._pydantic_core.ValidationError: 2 validation errors for Section layer.tuple[int, int] Input should be a valid tuple [type=tuple_type, input_value=1, input_type=int] For further information visit https://errors.pydantic.dev/2.8/v/tuple_type layer.str Input should be a valid string [type=string_type, input_value=1, input_type=int] For further information visit https://errors.pydantic.dev/2.8/v/string_type --------------------------------------------------------------------------- ValidationError Traceback (most recent call last) Cell In[24], line 1 ----> 1 sim.write_sparameters_lumerical( 2 component=c, layer_stack=layer_stack2, run=False, session=session 3 ) File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\gplugins\lumerical\write_sparameters_lumerical.py:241, in write_sparameters_lumerical(component, session, run, overwrite, dirpath, layer_stack, simulation_settings, material_name_to_lumerical, delete_fsp_files, xmargin, ymargin, xmargin_left, xmargin_right, ymargin_top, ymargin_bot, zmargin, **settings) 238 if not ports: 239 raise ValueError(f"{component.name!r} does not have any optical ports") --> 241 component_extended_beyond_pml = gf.components.extension.extend_ports( 242 component=component_extended, length=ss.port_extension 243 ) 244 component_extended_beyond_pml.name = "top" 245 gdspath = component_extended_beyond_pml.write_gds() File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\kfactory\kcell.py:4229, in KCLayout.cell..decorator_autocell..wrapper_autocell(*args, **kwargs) 4218 raise ValueError( 4219 "The KCell created must be using the same" 4220 " KCLayout object as the @cell decorator. " (...) 4225 "KCell(kcl=custom_kcl)." 4226 ) 4227 return cell -> 4229 _cell = wrapped_cell(**params) 4230 if _cell._destroyed(): 4231 # If the any cell has been destroyed, we should clean up the cache. 4232 # Delete all the KCell entrances in the cache which have 4233 # `_destroyed() == True` 4234 _deleted_cell_hashes: list[_HashedTuple] = [ 4235 _hash_item 4236 for _hash_item, _cell_item in _cache.items() 4237 if _cell_item._destroyed() 4238 ] File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\loguru\_logger.py:1277, in Logger.catch..Catcher.__call__..catch_wrapper(*args, **kwargs) 1275 def catch_wrapper(*args, **kwargs): 1276 with catcher: -> 1277 return function(*args, **kwargs) 1278 return default File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\cachetools\__init__.py:752, in cached..decorator..wrapper(*args, **kwargs) 750 except KeyError: 751 pass # key not found --> 752 v = func(*args, **kwargs) 753 try: 754 cache[k] = v File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\kfactory\kcell.py:4081, in KCLayout.cell..decorator_autocell..wrapper_autocell..wrapped_cell(**params) 4079 else: 4080 _name = None -> 4081 cell = f(**params) 4082 if not isinstance(cell, KCell): 4083 raise ValueError( 4084 f"Function did not return a KCell, but {type(cell)}" 4085 ) File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\gdsfactory\components\extension.py:129, in extend_ports(component, port_names, length, extension, port1, port2, port_type, centered, cross_section, extension_port_names, allow_width_mismatch, **kwargs) 127 extension_component = gf.get_component(extension) 128 else: --> 129 cross_section_extension = cross_section or cross_section_function( 130 layer=port.layer, width=port.dwidth 131 ) 133 if cross_section_extension is None: 134 raise ValueError("cross_section=None for extend_ports") File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\gdsfactory\cross_section.py:573, in cross_section(width, offset, layer, sections, port_names, port_types, bbox_layers, bbox_offsets, cladding_layers, cladding_offsets, cladding_simplify, radius, radius_min, main_section_name) 562 if ( 563 len( 564 {len(x) for x in (cladding_layers, cladding_offsets, cladding_simplify)} 565 ) 566 > 1 567 ): 568 raise ValueError( 569 f"{cladding_layers=}, {cladding_offsets=}, {cladding_simplify=} must have same length" 570 ) 572 s = [ --> 573 Section( 574 width=width, 575 offset=offset, 576 layer=layer, 577 port_names=port_names, 578 port_types=port_types, 579 name=main_section_name, 580 ) 581 ] + sections 583 if cladding_layers: 584 s += [ 585 Section(width=width + 2 * offset, layer=layer, simplify=simplify) 586 for layer, offset, simplify in zip( 587 cladding_layers, cladding_offsets, cladding_simplify 588 ) 589 ] File C:\MyPrograms\anaconda3\envs\gdsf\Lib\site-packages\pydantic\main.py:193, in BaseModel.__init__(self, **data) 191 # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks 192 __tracebackhide__ = True --> 193 self.__pydantic_validator__.validate_python(data, self_instance=self) ValidationError: 2 validation errors for Section layer.tuple[int, int] Input should be a valid tuple [type=tuple_type, input_value=1, input_type=int] For further information visit https://errors.pydantic.dev/2.8/v/tuple_type layer.str Input should be a valid string [type=string_type, input_value=1, input_type=int] For further information visit https://errors.pydantic.dev/2.8/v/string_type