MCPcopy Create free account
hub / github.com/numpy/numpy / make_code

Function make_code

numpy/core/code_generators/generate_umath.py:1361–1396  ·  view source on GitHub ↗
(funcdict, filename)

Source from the content-addressed store, hash-verified

1359
1360
1361def 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
1399def main():

Callers 1

mainFunction · 0.85

Calls 3

make_arraysFunction · 0.85
make_ufuncsFunction · 0.85
indentFunction · 0.85

Tested by

no test coverage detected