Skip to content

Commit c28f5c9

Browse files
Make shuffle pyx functions noexcept (#477)
* Make shuffle pyx functions return int * Update numcodecs/_shuffle.pyx Co-authored-by: jakirkham <[email protected]> * Update numcodecs/_shuffle.pyx Co-authored-by: jakirkham <[email protected]> * Note shuffle pyx functions are `noexcept` --------- Co-authored-by: jakirkham <[email protected]>
1 parent 1bc1e44 commit c28f5c9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/release.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ Release notes
1414
Fix
1515
~~~
1616

17-
* `Codec` is now derived from `abc.ABC`
17+
* ``Codec`` is now derived from ``abc.ABC``
1818
By :user:`Mads R. B. Kristensen <madsbk>`, :issue:`472`.
19+
* Make shuffle pyx functions ``noexcept``
20+
By :user:`Martin Durant <martindurant>`, :issue:`477`.
1921

2022
.. _release_0.12.0:
2123

numcodecs/_shuffle.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cimport cython
88

99
@cython.boundscheck(False)
1010
@cython.wraparound(False)
11-
cpdef void _doShuffle(const unsigned char[::1] src, unsigned char[::1] des, Py_ssize_t element_size) nogil:
11+
cpdef void _doShuffle(const unsigned char[::1] src, unsigned char[::1] des, Py_ssize_t element_size) noexcept nogil:
1212
cdef Py_ssize_t count, i, j, offset, byte_index
1313
count = len(src) // element_size
1414
for i in range(count):
@@ -20,7 +20,7 @@ cpdef void _doShuffle(const unsigned char[::1] src, unsigned char[::1] des, Py_s
2020

2121
@cython.boundscheck(False)
2222
@cython.wraparound(False)
23-
cpdef void _doUnshuffle(const unsigned char[::1] src, unsigned char[::1] des, Py_ssize_t element_size) nogil:
23+
cpdef void _doUnshuffle(const unsigned char[::1] src, unsigned char[::1] des, Py_ssize_t element_size) noexcept nogil:
2424
cdef Py_ssize_t count, i, j, offset, byte_index
2525
count = len(src) // element_size
2626
for i in range(element_size):

0 commit comments

Comments
 (0)