From 84795f5aa906260a54f9fd881692d9be7bf9ed8f Mon Sep 17 00:00:00 2001 From: Alex Tait Date: Tue, 12 Mar 2019 22:56:57 -0600 Subject: [PATCH] fixed bug in all reader --- lygadgets/cell_translation.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lygadgets/cell_translation.py b/lygadgets/cell_translation.py index 5c59509..8f642c8 100644 --- a/lygadgets/cell_translation.py +++ b/lygadgets/cell_translation.py @@ -101,6 +101,7 @@ def pyaCell_reader(pya_cell, filename, *args, **kwargs): else: if issubclass(celltype, phidl.Device): def phidlDevice_reader(phidl_device, filename, *args, port_layer=None, **kwargs): + # phidl_device is not really used. It is just there to determine type. #### hacks, because sometimes pya saves an extra topcell called $$$CONTEXT_INFO$$$ from gdspy import GdsLibrary gdsii_lib = GdsLibrary() @@ -127,10 +128,7 @@ def phidlDevice_reader(phidl_device, filename, *args, port_layer=None, **kwargs) port_layer = default_phidl_portlayer tempdevice = wop(tempdevice, layer=port_layer) # copy over from temporary device - for e in tempdevice.elements: - phidl_device.elements.append(e) - phidl_device.name = tempdevice.name - return phidl_device + return tempdevice return phidlDevice_reader # try: import gdspy