summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorNathaniel J. Smith <njs@pobox.com>2012-09-20 23:30:29 +0100
committerNathaniel J. Smith <njs@pobox.com>2012-09-20 23:30:29 +0100
commitc038fe59a8c355fee50a6c2ac236e750e0ad0ad5 (patch)
tree04a305d479eca635847715e94b3fda7bfe906587 /numpy
parentcea0a209875be753a74b8c7bb02aa9531726ee98 (diff)
downloadnumpy-c038fe59a8c355fee50a6c2ac236e750e0ad0ad5.tar.gz
STY: fix up style and a few wordings on previous commit
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h6
-rw-r--r--numpy/core/src/multiarray/common.c6
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c8
-rw-r--r--numpy/core/tests/test_ufunc.py6
4 files changed, 16 insertions, 10 deletions
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index 523601570..93d561c7c 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -201,8 +201,10 @@ typedef enum {
/* Allow any casts */
NPY_UNSAFE_CASTING=4,
- /* Temporary internal definition only, will be removed in upcoming
- release, see below */
+ /*
+ * Temporary internal definition only, will be removed in upcoming
+ * release, see below
+ * */
NPY_INTERNAL_UNSAFE_CASTING_BUT_WARN_UNLESS_SAME_KIND = 100,
} NPY_CASTING;
diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c
index 917946b48..7b8177c5c 100644
--- a/numpy/core/src/multiarray/common.c
+++ b/numpy/core/src/multiarray/common.c
@@ -13,12 +13,14 @@
#include "common.h"
#include "buffer.h"
-/* The casting to use for implicit assignment operations resulting from
+/*
+ * The casting to use for implicit assignment operations resulting from
* in-place operations (like +=) and out= arguments. (Notice that this
* variable is misnamed, but it's part of the public API so I'm not sure we
* can just change it. Maybe someone should try and see if anyone notices.
*/
-/* In numpy 1.6 and earlier, this was NPY_UNSAFE_CASTING. In a future
+/*
+ * In numpy 1.6 and earlier, this was NPY_UNSAFE_CASTING. In a future
* release, it will become NPY_SAME_KIND_CASTING. Right now, during the
* transitional period, we continue to follow the NPY_UNSAFE_CASTING rules (to
* avoid breaking people's code), but we also check for whether the cast would
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index b4f20c000..586b85b1e 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -503,7 +503,8 @@ type_num_unsigned_to_signed(int type_num)
}
}
-/* NOTE: once the UNSAFE_CASTING -> SAME_KIND_CASTING transition is over,
+/*
+ * NOTE: once the UNSAFE_CASTING -> SAME_KIND_CASTING transition is over,
* we should remove NPY_INTERNAL_UNSAFE_CASTING_BUT_WARN_UNLESS_SAME_KIND
* and PyArray_CanCastTypeTo_impl should be renamed back to
* PyArray_CanCastTypeTo.
@@ -527,11 +528,12 @@ PyArray_CanCastTypeTo(PyArray_Descr *from, PyArray_Descr *to,
NPY_SAME_KIND_CASTING);
if (unsafe_ok && !same_kind_ok) {
DEPRECATE("Implicitly casting between incompatible kinds. In "
- "a future numpy release, this will become an error. "
+ "a future numpy release, this will raise an error. "
"Use casting=\"unsafe\" if this is intentional.");
}
return unsafe_ok;
- } else {
+ }
+ else {
return PyArray_CanCastTypeTo_impl(from, to, casting);
}
}
diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py
index fb6b586be..84d304595 100644
--- a/numpy/core/tests/test_ufunc.py
+++ b/numpy/core/tests/test_ufunc.py
@@ -743,9 +743,9 @@ class TestUfunc(TestCase):
uf.accumulate(np.zeros((0, 0)), axis=0)
def test_safe_casting(self):
- # In old numpy's, any casting was allowed for in-place operations. In
- # future numpy's, only same_kind casting will be allowed by
- # default.
+ # In old numpy's, unsafe casting was allowed for in-place
+ # operations. In future numpy's, only same_kind casting will be
+ # allowed by default.
a = np.array([1, 2, 3], dtype=int)
# Non-in-place addition is fine
assert_array_equal(assert_no_warnings(np.add, a, 1.1),