(funcdict, filename)
| 1359 | |
| 1360 | |
| 1361 | def make_code(funcdict, filename): |
| 1362 | code1, code2 = make_arrays(funcdict) |
| 1363 | code3 = make_ufuncs(funcdict) |
| 1364 | code2 = indent(code2, 4) |
| 1365 | code3 = indent(code3, 4) |
| 1366 | code = textwrap.dedent(r""" |
| 1367 | |
| 1368 | /** Warning this file is autogenerated!!! |
| 1369 | |
| 1370 | Please make changes to the code generator program (%s) |
| 1371 | **/ |
| 1372 | #include "ufunc_object.h" |
| 1373 | #include "ufunc_type_resolution.h" |
| 1374 | #include "loops.h" |
| 1375 | #include "matmul.h" |
| 1376 | #include "clip.h" |
| 1377 | #include "dtypemeta.h" |
| 1378 | #include "_umath_doc_generated.h" |
| 1379 | |
| 1380 | %s |
| 1381 | /* Returns a borrowed ref of the second value in the matching info tuple */ |
| 1382 | PyObject * |
| 1383 | get_info_no_cast(PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtype, |
| 1384 | int ndtypes); |
| 1385 | |
| 1386 | static int |
| 1387 | InitOperators(PyObject *dictionary) { |
| 1388 | PyObject *f, *identity; |
| 1389 | |
| 1390 | %s |
| 1391 | %s |
| 1392 | |
| 1393 | return 0; |
| 1394 | } |
| 1395 | """) % (os.path.basename(filename), code1, code2, code3) |
| 1396 | return code |
| 1397 | |
| 1398 | |
| 1399 | def main(): |
no test coverage detected