Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example error 'TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')' #57

Open
unnir opened this issue Jan 25, 2018 · 3 comments

Comments

@unnir
Copy link

unnir commented Jan 25, 2018

I'm trying to start the example script:

import os.path
from gdsCAD import *

# Create some things to draw:
amarks = templates.AlignmentMarks(('A', 'C'), (1,2))
text = shapes.Label('Hello\nworld!', 200, (0, 0))
box = shapes.Box((-500, -400), (1500, 400), 10, layer=2)

# Create a Cell to hold the objects
cell = core.Cell('EXAMPLE')
cell.add([text, box])
cell.add(amarks, origin=(-200, 0))
cell.add(amarks, origin=(1200, 0))

# Create two copies of the Cell
top = core.Cell('TOP')
cell_array = core.CellArray(cell, 1, 2, (0, 850))
top.add(cell_array)

# Add the copied cell to a Layout and save
layout = core.Layout('LIBRARY')
layout.add(top)
layout.save('output.gds')

layout.show()

And getting this error:

TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')

@Rory-Lambert
Copy link

The maintainer of this repo is not very active. Anyway, I'm pretty sure you're having the same problem as everyone else: there's a line in the source code that needs changing. Pasted from my issue submission;

This has actually been identified previously on stackoverflow. The top voted answer sorted the issue for me.
https://stackoverflow.com/questions/34264282/typeerror-ufunc-add-did-not-contain-a-loop

Follow the link, follow the advice and it should work like a charm. Hope this helps!

@dorianherle
Copy link

Thanks a lot for this helpful comment !

@nmz787
Copy link

nmz787 commented Apr 5, 2019

to save people time scrolling and searching through the few answers on that stackoverflow post, the fix is:
open gdsCAD/core.py
change this line:
colors += matplotlib.cm.gist_ncar(np.linspace(0.98, 0, 15))
to this line:
colors += list(matplotlib.cm.gist_ncar(np.linspace(0.98, 0, 15)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants