summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/multiarray/array_coercion.c14
-rw-r--r--numpy/core/src/multiarray/array_coercion.h2
-rw-r--r--numpy/core/src/multiarray/ctors.c6
-rw-r--r--numpy/core/src/multiarray/ctors.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/numpy/core/src/multiarray/array_coercion.c b/numpy/core/src/multiarray/array_coercion.c
index aa5f1f2fd..8778ec20c 100644
--- a/numpy/core/src/multiarray/array_coercion.c
+++ b/numpy/core/src/multiarray/array_coercion.c
@@ -857,7 +857,7 @@ PyArray_AdaptDescriptorToArray(PyArrayObject *arr, PyObject *dtype)
* (Initially it is a pointer to the user-provided head pointer).
* @param fixed_DType User provided fixed DType class
* @param flags Discovery flags (reporting and behaviour flags, see def.)
- * @param do_copy Specifies if a copy is to be made during array creation.
+ * @param allow_copy Specifies if a copy is allowed during array creation.
* @return The updated number of maximum dimensions (i.e. scalars will set
* this to the current dimensions).
*/
@@ -867,7 +867,7 @@ PyArray_DiscoverDTypeAndShape_Recursive(
npy_intp out_shape[NPY_MAXDIMS],
coercion_cache_obj ***coercion_cache_tail_ptr,
PyArray_DTypeMeta *fixed_DType, enum _dtype_discovery_flags *flags,
- int do_copy)
+ int allow_copy)
{
PyArrayObject *arr = NULL;
PyObject *seq;
@@ -925,7 +925,7 @@ PyArray_DiscoverDTypeAndShape_Recursive(
requested_descr = *out_descr;
}
arr = (PyArrayObject *)_array_from_array_like(obj,
- requested_descr, 0, NULL, do_copy);
+ requested_descr, 0, NULL, allow_copy);
if (arr == NULL) {
return -1;
}
@@ -1119,7 +1119,7 @@ PyArray_DiscoverDTypeAndShape_Recursive(
max_dims = PyArray_DiscoverDTypeAndShape_Recursive(
objects[i], curr_dims + 1, max_dims,
out_descr, out_shape, coercion_cache_tail_ptr, fixed_DType,
- flags, do_copy);
+ flags, allow_copy);
if (max_dims < 0) {
return -1;
@@ -1159,7 +1159,7 @@ PyArray_DiscoverDTypeAndShape_Recursive(
* The result may be unchanged (remain NULL) when converting a
* sequence with no elements. In this case it is callers responsibility
* to choose a default.
- * @param do_copy Specifies if a copy is to be made during array creation.
+ * @param allow_copy Specifies if a copy is allowed during array creation.
* @return dimensions of the discovered object or -1 on error.
* WARNING: If (and only if) the output is a single array, the ndim
* returned _can_ exceed the maximum allowed number of dimensions.
@@ -1172,7 +1172,7 @@ PyArray_DiscoverDTypeAndShape(
npy_intp out_shape[NPY_MAXDIMS],
coercion_cache_obj **coercion_cache,
PyArray_DTypeMeta *fixed_DType, PyArray_Descr *requested_descr,
- PyArray_Descr **out_descr, int do_copy)
+ PyArray_Descr **out_descr, int allow_copy)
{
coercion_cache_obj **coercion_cache_head = coercion_cache;
*coercion_cache = NULL;
@@ -1217,7 +1217,7 @@ PyArray_DiscoverDTypeAndShape(
int ndim = PyArray_DiscoverDTypeAndShape_Recursive(
obj, 0, max_dims, out_descr, out_shape, &coercion_cache,
- fixed_DType, &flags, do_copy);
+ fixed_DType, &flags, allow_copy);
if (ndim < 0) {
goto fail;
}
diff --git a/numpy/core/src/multiarray/array_coercion.h b/numpy/core/src/multiarray/array_coercion.h
index fe59b731c..4790d8030 100644
--- a/numpy/core/src/multiarray/array_coercion.h
+++ b/numpy/core/src/multiarray/array_coercion.h
@@ -31,7 +31,7 @@ PyArray_DiscoverDTypeAndShape(
npy_intp out_shape[NPY_MAXDIMS],
coercion_cache_obj **coercion_cache,
PyArray_DTypeMeta *fixed_DType, PyArray_Descr *requested_descr,
- PyArray_Descr **out_descr, int do_copy);
+ PyArray_Descr **out_descr, int allow_copy);
NPY_NO_EXPORT int
PyArray_ExtractDTypeAndDescriptor(PyObject *dtype,
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index ca3a29d53..d9289dc96 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -1284,7 +1284,7 @@ fail:
* DType may be used, but is not enforced.
* @param writeable whether the result must be writeable.
* @param context Unused parameter, must be NULL (should be removed later).
- * @param do_copy Specifies if a copy is to be made during array creation.
+ * @param allow_copy Specifies if a copy is allowed during array creation.
*
* @returns The array object, Py_NotImplemented if op is not array-like,
* or NULL with an error set. (A new reference to Py_NotImplemented
@@ -1293,7 +1293,7 @@ fail:
NPY_NO_EXPORT PyObject *
_array_from_array_like(PyObject *op,
PyArray_Descr *requested_dtype, npy_bool writeable, PyObject *context,
- int do_copy) {
+ int allow_copy) {
PyObject* tmp;
/*
@@ -1351,7 +1351,7 @@ _array_from_array_like(PyObject *op,
if (!writeable && tmp == Py_NotImplemented) {
PyObject* array_meth = PyArray_LookupSpecial_OnInstance(op, "__array__");
int has_get = array_meth && PyType_Check(op) && PyObject_HasAttrString(array_meth, "__get__");
- if (array_meth != NULL && !has_get && do_copy) {
+ if (array_meth != NULL && !has_get && allow_copy) {
PyErr_SetString(PyExc_ValueError, "Calling __array__ in never copy mode is not allowed.");
return NULL;
}
diff --git a/numpy/core/src/multiarray/ctors.h b/numpy/core/src/multiarray/ctors.h
index 4f8bd5a82..cf01a6256 100644
--- a/numpy/core/src/multiarray/ctors.h
+++ b/numpy/core/src/multiarray/ctors.h
@@ -33,7 +33,7 @@ PyArray_New(
NPY_NO_EXPORT PyObject *
_array_from_array_like(PyObject *op,
PyArray_Descr *requested_dtype, npy_bool writeable, PyObject *context,
- int do_copy);
+ int allow_copy);
NPY_NO_EXPORT PyObject *
PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth,