hohlraum / gdsCAD

A simple but powerful Python package for creating photolithography masks in the GDSII format.
GNU General Public License v3.0
88 stars 52 forks source link

gdsImport does not work for hierarchical gds #43

Closed muab closed 8 years ago

muab commented 8 years ago

gdsImport seems to work for a flat gds, but not for the same design when it's a hierarchical version which includes other subcells. the error is: Traceback (most recent call last): File "gds_tests.py", line 11, in amarks = core.GdsImport(myfile)#, verbose=2) File "/usr/local/lib/python2.7/dist-packages/gdsCAD-0.5.0-py2.7.egg/gdsCAD/core.py", line 2388, in GdsImport layout.add(c) File "/usr/local/lib/python2.7/dist-packages/gdsCAD-0.5.0-py2.7.egg/gdsCAD/core.py", line 1241, in add names=[c.name for c in self.get_dependencies()]
File "/usr/local/lib/python2.7/dist-packages/gdsCAD-0.5.0-py2.7.egg/gdsCAD/core.py", line 1260, in get_dependencies dependencies |= set(cell.get_dependencies()) File "/usr/local/lib/python2.7/dist-packages/gdsCAD-0.5.0-py2.7.egg/gdsCAD/core.py", line 1678, in get_dependencies dependencies += reference.get_dependencies(include_elements) File "/usr/local/lib/python2.7/dist-packages/gdsCAD-0.5.0-py2.7.egg/gdsCAD/core.py", line 1784, in get_dependencies return [self.ref_cell]+self.ref_cell.get_dependencies(include_elements) File "/usr/local/lib/python2.7/dist-packages/gdsCAD-0.5.0-py2.7.egg/gdsCAD/core.py", line 1678, in get_dependencies dependencies += reference.get_dependencies(include_elements) File "/usr/local/lib/python2.7/dist-packages/gdsCAD-0.5.0-py2.7.egg/gdsCAD/core.py", line 1784, in get_dependencies return [self.ref_cell]+self.ref_cell.get_dependencies(include_elements) AttributeError: 'str' object has no attribute 'get_dependencies'

muab commented 8 years ago

I found the issue. It was not related to flat or hierarchical gds. apparently it will crash when the cells have a name that include $ and = characters. This happened to me with cells that I had on the hierarchy, hence my erroneous assumption. If you change this names in the gds for underscore _ for instance, the import will apparently work without any problem, for flat and hierarchical gds.