summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-03-20 23:58:04 -0700
committerEric Wieser <wieser.eric@gmail.com>2019-03-20 23:58:04 -0700
commite0dc67203e38e3e32e8bc89cbd202fa12884ffd3 (patch)
treef439f38a973ca9afc121c009a95e243dfd08d847 /numpy
parent251c526672f897543176b966229ecde96bb89a9d (diff)
downloadnumpy-e0dc67203e38e3e32e8bc89cbd202fa12884ffd3.tar.gz
STY: Fix weird indents to be multiples of 4 spaces
Diffstat (limited to 'numpy')
-rw-r--r--numpy/_build_utils/src/apple_sgemv_fix.c54
-rw-r--r--numpy/core/src/common/array_assign.c2
-rw-r--r--numpy/core/src/multiarray/array_assign_array.c16
-rw-r--r--numpy/core/src/multiarray/compiled_base.c2
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.c4
-rw-r--r--numpy/core/src/multiarray/flagsobject.c2
-rw-r--r--numpy/core/src/multiarray/hashdescr.c22
-rw-r--r--numpy/core/src/multiarray/item_selection.c2
-rw-r--r--numpy/core/src/multiarray/mapping.c40
-rw-r--r--numpy/core/src/multiarray/nditer_constr.c4
-rw-r--r--numpy/core/src/umath/ufunc_object.c4
-rw-r--r--numpy/core/src/umath/umathmodule.c2
-rw-r--r--numpy/random/mtrand/distributions.c2
13 files changed, 78 insertions, 78 deletions
diff --git a/numpy/_build_utils/src/apple_sgemv_fix.c b/numpy/_build_utils/src/apple_sgemv_fix.c
index 4c9c82ece..788a62e61 100644
--- a/numpy/_build_utils/src/apple_sgemv_fix.c
+++ b/numpy/_build_utils/src/apple_sgemv_fix.c
@@ -76,7 +76,7 @@ static int AVX_and_10_9 = 0;
__attribute__((destructor))
static void unloadlib(void)
{
- if (veclib) dlclose(veclib);
+ if (veclib) dlclose(veclib);
}
__attribute__((constructor))
@@ -198,30 +198,30 @@ void cblas_sgemv(const enum CBLAS_ORDER order,
const float *X, const int incX, const float beta,
float *Y, const int incY)
{
- char TA;
- if (order == CblasColMajor)
- {
- if (TransA == CblasNoTrans) TA = 'N';
- else if (TransA == CblasTrans) TA = 'T';
- else if (TransA == CblasConjTrans) TA = 'C';
- else
- {
- cblas_xerbla(2, "cblas_sgemv","Illegal TransA setting, %d\n", TransA);
- }
- sgemv_(&TA, &M, &N, &alpha, A, &lda, X, &incX, &beta, Y, &incY);
- }
- else if (order == CblasRowMajor)
- {
- if (TransA == CblasNoTrans) TA = 'T';
- else if (TransA == CblasTrans) TA = 'N';
- else if (TransA == CblasConjTrans) TA = 'N';
- else
- {
- cblas_xerbla(2, "cblas_sgemv", "Illegal TransA setting, %d\n", TransA);
- return;
- }
- sgemv_(&TA, &N, &M, &alpha, A, &lda, X, &incX, &beta, Y, &incY);
- }
- else
- cblas_xerbla(1, "cblas_sgemv", "Illegal Order setting, %d\n", order);
+ char TA;
+ if (order == CblasColMajor)
+ {
+ if (TransA == CblasNoTrans) TA = 'N';
+ else if (TransA == CblasTrans) TA = 'T';
+ else if (TransA == CblasConjTrans) TA = 'C';
+ else
+ {
+ cblas_xerbla(2, "cblas_sgemv","Illegal TransA setting, %d\n", TransA);
+ }
+ sgemv_(&TA, &M, &N, &alpha, A, &lda, X, &incX, &beta, Y, &incY);
+ }
+ else if (order == CblasRowMajor)
+ {
+ if (TransA == CblasNoTrans) TA = 'T';
+ else if (TransA == CblasTrans) TA = 'N';
+ else if (TransA == CblasConjTrans) TA = 'N';
+ else
+ {
+ cblas_xerbla(2, "cblas_sgemv", "Illegal TransA setting, %d\n", TransA);
+ return;
+ }
+ sgemv_(&TA, &N, &M, &alpha, A, &lda, X, &incX, &beta, Y, &incY);
+ }
+ else
+ cblas_xerbla(1, "cblas_sgemv", "Illegal Order setting, %d\n", order);
}
diff --git a/numpy/core/src/common/array_assign.c b/numpy/core/src/common/array_assign.c
index 02a423e3a..0ac1b01c6 100644
--- a/numpy/core/src/common/array_assign.c
+++ b/numpy/core/src/common/array_assign.c
@@ -79,7 +79,7 @@ broadcast_error: {
Py_DECREF(errmsg);
return -1;
- }
+ }
}
/* See array_assign.h for parameter documentation */
diff --git a/numpy/core/src/multiarray/array_assign_array.c b/numpy/core/src/multiarray/array_assign_array.c
index 6e31fd3f7..7ff33ebd7 100644
--- a/numpy/core/src/multiarray/array_assign_array.c
+++ b/numpy/core/src/multiarray/array_assign_array.c
@@ -420,14 +420,14 @@ PyArray_AssignArray(PyArrayObject *dst, PyArrayObject *src,
/* A straightforward where-masked assignment */
/* Do the masked assignment with raw array iteration */
- if (raw_array_wheremasked_assign_array(
- PyArray_NDIM(dst), PyArray_DIMS(dst),
- PyArray_DESCR(dst), PyArray_DATA(dst), PyArray_STRIDES(dst),
- PyArray_DESCR(src), PyArray_DATA(src), src_strides,
- PyArray_DESCR(wheremask), PyArray_DATA(wheremask),
- wheremask_strides) < 0) {
- goto fail;
- }
+ if (raw_array_wheremasked_assign_array(
+ PyArray_NDIM(dst), PyArray_DIMS(dst),
+ PyArray_DESCR(dst), PyArray_DATA(dst), PyArray_STRIDES(dst),
+ PyArray_DESCR(src), PyArray_DATA(src), src_strides,
+ PyArray_DESCR(wheremask), PyArray_DATA(wheremask),
+ wheremask_strides) < 0) {
+ goto fail;
+ }
}
if (copied_src) {
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index 2da274658..1e0c1eb5f 100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -1198,7 +1198,7 @@ arr_unravel_index(PyObject *self, PyObject *args, PyObject *kwds)
* if "dims" is detected in keywords, then replace it with
* the new "shape" argument and continue processing as usual.
*/
- if (kwds) {
+ if (kwds) {
PyObject *dims_item, *shape_item;
dims_item = PyDict_GetItemString(kwds, "dims");
shape_item = PyDict_GetItemString(kwds, "shape");
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index 3ab07ad31..a90416a40 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -2375,7 +2375,7 @@ get_subarray_transfer_function(int aligned,
/* Get the subarray shapes and sizes */
if (PyDataType_HASSUBARRAY(src_dtype)) {
- if (!(PyArray_IntpConverter(src_dtype->subarray->shape,
+ if (!(PyArray_IntpConverter(src_dtype->subarray->shape,
&src_shape))) {
PyErr_SetString(PyExc_ValueError,
"invalid subarray shape");
@@ -2385,7 +2385,7 @@ get_subarray_transfer_function(int aligned,
src_dtype = src_dtype->subarray->base;
}
if (PyDataType_HASSUBARRAY(dst_dtype)) {
- if (!(PyArray_IntpConverter(dst_dtype->subarray->shape,
+ if (!(PyArray_IntpConverter(dst_dtype->subarray->shape,
&dst_shape))) {
npy_free_cache_dim_obj(src_shape);
PyErr_SetString(PyExc_ValueError,
diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c
index 85ea49fb4..e378f1133 100644
--- a/numpy/core/src/multiarray/flagsobject.c
+++ b/numpy/core/src/multiarray/flagsobject.c
@@ -147,7 +147,7 @@ _UpdateContiguousFlags(PyArrayObject *ap)
if (PyArray_STRIDES(ap)[i] != sd) {
is_c_contig = 0;
break;
- }
+ }
/* contiguous, if it got this far */
if (dim == 0) {
break;
diff --git a/numpy/core/src/multiarray/hashdescr.c b/numpy/core/src/multiarray/hashdescr.c
index 8465093b9..0b23b6c21 100644
--- a/numpy/core/src/multiarray/hashdescr.c
+++ b/numpy/core/src/multiarray/hashdescr.c
@@ -36,17 +36,17 @@ static int _array_descr_builtin(PyArray_Descr* descr, PyObject *l);
*/
static char _normalize_byteorder(char byteorder)
{
- switch(byteorder) {
- case '=':
- if (PyArray_GetEndianness() == NPY_CPU_BIG) {
- return '>';
- }
- else {
- return '<';
- }
- default:
- return byteorder;
- }
+ switch(byteorder) {
+ case '=':
+ if (PyArray_GetEndianness() == NPY_CPU_BIG) {
+ return '>';
+ }
+ else {
+ return '<';
+ }
+ default:
+ return byteorder;
+ }
}
/*
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 4888224f3..5a40803db 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -2392,7 +2392,7 @@ PyArray_MultiIndexGetItem(PyArrayObject *self, npy_intp *multi_index)
npy_intp ind = multi_index[idim];
if (check_and_adjust_index(&ind, shapevalue, idim, NULL) < 0) {
- return NULL;
+ return NULL;
}
data += ind * strides[idim];
}
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index 17edd2bbf..10206c03e 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -710,26 +710,26 @@ prepare_index(PyArrayObject *self, PyObject *index,
* to find the ellipsis value or append an ellipsis if necessary.
*/
if (used_ndim < PyArray_NDIM(self)) {
- if (index_type & HAS_ELLIPSIS) {
- indices[ellipsis_pos].value = PyArray_NDIM(self) - used_ndim;
- used_ndim = PyArray_NDIM(self);
- new_ndim += indices[ellipsis_pos].value;
- }
- else {
- /*
- * There is no ellipsis yet, but it is not a full index
- * so we append an ellipsis to the end.
- */
- index_type |= HAS_ELLIPSIS;
- indices[curr_idx].object = NULL;
- indices[curr_idx].type = HAS_ELLIPSIS;
- indices[curr_idx].value = PyArray_NDIM(self) - used_ndim;
- ellipsis_pos = curr_idx;
-
- used_ndim = PyArray_NDIM(self);
- new_ndim += indices[curr_idx].value;
- curr_idx += 1;
- }
+ if (index_type & HAS_ELLIPSIS) {
+ indices[ellipsis_pos].value = PyArray_NDIM(self) - used_ndim;
+ used_ndim = PyArray_NDIM(self);
+ new_ndim += indices[ellipsis_pos].value;
+ }
+ else {
+ /*
+ * There is no ellipsis yet, but it is not a full index
+ * so we append an ellipsis to the end.
+ */
+ index_type |= HAS_ELLIPSIS;
+ indices[curr_idx].object = NULL;
+ indices[curr_idx].type = HAS_ELLIPSIS;
+ indices[curr_idx].value = PyArray_NDIM(self) - used_ndim;
+ ellipsis_pos = curr_idx;
+
+ used_ndim = PyArray_NDIM(self);
+ new_ndim += indices[curr_idx].value;
+ curr_idx += 1;
+ }
}
else if (used_ndim > PyArray_NDIM(self)) {
PyErr_SetString(PyExc_IndexError,
diff --git a/numpy/core/src/multiarray/nditer_constr.c b/numpy/core/src/multiarray/nditer_constr.c
index dc58b3a78..3b3635afe 100644
--- a/numpy/core/src/multiarray/nditer_constr.c
+++ b/numpy/core/src/multiarray/nditer_constr.c
@@ -2120,8 +2120,8 @@ npyiter_apply_forced_iteration_order(NpyIter *iter, NPY_ORDER order)
/* Check that all the array inputs are fortran order */
for (iop = 0; iop < nop; ++iop, ++op) {
if (*op && !PyArray_CHKFLAGS(*op, NPY_ARRAY_F_CONTIGUOUS)) {
- forder = 0;
- break;
+ forder = 0;
+ break;
}
}
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index f198a19bd..f5084e6b3 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -563,14 +563,14 @@ _get_size(const char* str)
if (stop == str || _is_alpha_underscore(*stop)) {
/* not a well formed number */
- return -1;
+ return -1;
}
if (size >= NPY_MAX_INTP || size <= NPY_MIN_INTP) {
/* len(str) too long */
return -1;
}
return size;
- }
+}
/*
* Return the ending position of a variable name including optional modifier
diff --git a/numpy/core/src/umath/umathmodule.c b/numpy/core/src/umath/umathmodule.c
index 23e3ffcfc..6ec474376 100644
--- a/numpy/core/src/umath/umathmodule.c
+++ b/numpy/core/src/umath/umathmodule.c
@@ -187,7 +187,7 @@ add_newdoc_ufunc(PyObject *NPY_UNUSED(dummy), PyObject *args)
#else
if (!PyArg_ParseTuple(args, "O!O!:_add_newdoc_ufunc", &PyUFunc_Type, &ufunc,
&PyString_Type, &str)) {
- return NULL;
+ return NULL;
}
docstr = PyString_AS_STRING(str);
#endif
diff --git a/numpy/random/mtrand/distributions.c b/numpy/random/mtrand/distributions.c
index 2548a646e..de397ccfa 100644
--- a/numpy/random/mtrand/distributions.c
+++ b/numpy/random/mtrand/distributions.c
@@ -894,7 +894,7 @@ double rk_triangular(rk_state *state, double left, double mode, double right)
return left + sqrt(U*leftprod);
} else
{
- return right - sqrt((1.0 - U) * rightprod);
+ return right - sqrt((1.0 - U) * rightprod);
}
}