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

Function array_concatenate

numpy/core/src/multiarray/multiarraymodule.c:2530–2578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2528}
2529
2530static PyObject *
2531array_concatenate(PyObject *NPY_UNUSED(dummy),
2532 PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames)
2533{
2534 PyObject *a0;
2535 PyObject *out = NULL;
2536 PyArray_Descr *dtype = NULL;
2537 NPY_CASTING casting = NPY_SAME_KIND_CASTING;
2538 PyObject *casting_obj = NULL;
2539 PyObject *res;
2540 int axis = 0;
2541
2542 NPY_PREPARE_ARGPARSER;
2543 if (npy_parse_arguments("concatenate", args, len_args, kwnames,
2544 "seq", NULL, &a0,
2545 "|axis", &PyArray_AxisConverter, &axis,
2546 "|out", NULL, &out,
2547 "$dtype", &PyArray_DescrConverter2, &dtype,
2548 "$casting", NULL, &casting_obj,
2549 NULL, NULL, NULL) < 0) {
2550 return NULL;
2551 }
2552 int casting_not_passed = 0;
2553 if (casting_obj == NULL) {
2554 /*
2555 * Casting was not passed in, needed for deprecation only.
2556 * This should be simplified once the deprecation is finished.
2557 */
2558 casting_not_passed = 1;
2559 }
2560 else if (!PyArray_CastingConverter(casting_obj, &casting)) {
2561 Py_XDECREF(dtype);
2562 return NULL;
2563 }
2564 if (out != NULL) {
2565 if (out == Py_None) {
2566 out = NULL;
2567 }
2568 else if (!PyArray_Check(out)) {
2569 PyErr_SetString(PyExc_TypeError, "'out' must be an array");
2570 Py_XDECREF(dtype);
2571 return NULL;
2572 }
2573 }
2574 res = PyArray_ConcatenateInto(a0, axis, (PyArrayObject *)out, dtype,
2575 casting, casting_not_passed);
2576 Py_XDECREF(dtype);
2577 return res;
2578}
2579
2580static PyObject *
2581array_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *const *args, Py_ssize_t len_args)

Callers

nothing calls this directly

Calls 2

PyArray_CastingConverterFunction · 0.85
PyArray_ConcatenateIntoFunction · 0.85

Tested by

no test coverage detected