Skip to content

Make shuffle pyx functions noexcept #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ Release notes
Fix
~~~

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

.. _release_0.12.0:

Expand Down
4 changes: 2 additions & 2 deletions numcodecs/_shuffle.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cimport cython

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

@cython.boundscheck(False)
@cython.wraparound(False)
cpdef void _doUnshuffle(const unsigned char[::1] src, unsigned char[::1] des, Py_ssize_t element_size) nogil:
cpdef void _doUnshuffle(const unsigned char[::1] src, unsigned char[::1] des, Py_ssize_t element_size) noexcept nogil:
cdef Py_ssize_t count, i, j, offset, byte_index
count = len(src) // element_size
for i in range(element_size):
Expand Down