We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd40863 commit c08fc2aCopy full SHA for c08fc2a
tools/generate.py
@@ -209,8 +209,10 @@ def cleanup(name):
209
cast = '<int*>'
210
else:
211
assert False, arg
212
- print(' assert PyArray_TYPE(%s) == np.NPY_DOUBLE, "%s is not double"' % (var, var))
213
- print(' assert %s.ndim == 1, "%s has wrong dimensions"' % (var, var))
+ print(' if PyArray_TYPE(%s) != np.NPY_DOUBLE:' % var)
+ print(' raise Exception("%s is not double")' % var)
214
+ print(' if %s.ndim != 1:' % var)
215
+ print(' raise Exception("%s has wrong dimensions")' % var)
216
print(' if not (PyArray_FLAGS(%s) & np.NPY_C_CONTIGUOUS):' % var)
217
print(' %s = PyArray_GETCONTIGUOUS(%s)' % (var, var))
218
print(' %s_data = %s%s.data' % (var, cast, var))
0 commit comments