I am trying to run the first script on the documentation page:
The Code:
`from gdsCAD import *
cell=core.Cell('TOP')
for l in (3,6,10):
box=shapes.Box((-l,-l), (l,l), width=0.2, layer=2)
cell.add(box)
layout = core.Layout('LIBRARY')
layout.add(cell)
layout.save('output.gds')
layout.show()
`
I am getting the following error:
Writing the following cells
TOP: Cell ("TOP", 3 elements, 0 references)
Traceback (most recent call last):
File "p1.py", line 18, in
layout.show()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 82, in _show
artists=self.artist()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 1132, in artist
artists += c.artist()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 1389, in artist
art+=e.artist()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 477, in artist
return [descartes.PolygonPatch(poly, lw=0, **self._layer_properties(self.layer))]
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 105, in _layer_properties
colors += matplotlib.cm.gist_ncar(np.linspace(0.98, 0, 15))
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')
I am not sure how to solve this problem. Thanks for you help.
solution seems to be the same as that of #36 in the thread change line 105 in core.py to : colors += list(matplotlib.cm.gist_ncar(np.linspace(0.98, 0,15)))
Hello,
I am trying to run the first script on the documentation page:
The Code: `from gdsCAD import *
cell=core.Cell('TOP')
for l in (3,6,10): box=shapes.Box((-l,-l), (l,l), width=0.2, layer=2) cell.add(box)
layout = core.Layout('LIBRARY') layout.add(cell)
layout.save('output.gds') layout.show() `
I am getting the following error: Writing the following cells TOP: Cell ("TOP", 3 elements, 0 references) Traceback (most recent call last): File "p1.py", line 18, in
layout.show()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 82, in _show
artists=self.artist()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 1132, in artist
artists += c.artist()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 1389, in artist
art+=e.artist()
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 477, in artist
return [descartes.PolygonPatch(poly, lw=0, **self._layer_properties(self.layer))]
File "/Users/Prabudhya/anaconda2/lib/python2.7/site-packages/gdsCAD-0.4.5-py2.7.egg/gdsCAD/core.py", line 105, in _layer_properties
colors += matplotlib.cm.gist_ncar(np.linspace(0.98, 0, 15))
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')
I am not sure how to solve this problem. Thanks for you help.
Pra