From 888fd7719965719321f160f79051aa5caf42b9ac Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 13 May 2023 21:33:45 -0400 Subject: MNT: compatibility with cython3 This is fallout from https://github.com/cython/cython/pull/5386 --- numpy/random/_pcg64.pyx | 11 +++++------ numpy/random/_philox.pyx | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'numpy') diff --git a/numpy/random/_pcg64.pyx b/numpy/random/_pcg64.pyx index dee38c039..f7891aa85 100644 --- a/numpy/random/_pcg64.pyx +++ b/numpy/random/_pcg64.pyx @@ -26,8 +26,8 @@ cdef extern from "src/pcg64/pcg64.h": void pcg64_get_state(pcg64_state *state, uint64_t *state_arr, int *has_uint32, uint32_t *uinteger) void pcg64_set_state(pcg64_state *state, uint64_t *state_arr, int has_uint32, uint32_t uinteger) - uint64_t pcg64_cm_next64(pcg64_state *state) nogil - uint32_t pcg64_cm_next32(pcg64_state *state) nogil + uint64_t pcg64_cm_next64(pcg64_state *state) noexcept nogil + uint32_t pcg64_cm_next32(pcg64_state *state) noexcept nogil void pcg64_cm_advance(pcg64_state *state, uint64_t *step) cdef uint64_t pcg64_uint64(void* st) noexcept nogil: @@ -39,13 +39,13 @@ cdef uint32_t pcg64_uint32(void *st) noexcept nogil: cdef double pcg64_double(void* st) noexcept nogil: return uint64_to_double(pcg64_next64(st)) -cdef uint64_t pcg64_cm_uint64(void* st) nogil: +cdef uint64_t pcg64_cm_uint64(void* st) noexcept nogil: return pcg64_cm_next64(st) -cdef uint32_t pcg64_cm_uint32(void *st) nogil: +cdef uint32_t pcg64_cm_uint32(void *st) noexcept nogil: return pcg64_cm_next32( st) -cdef double pcg64_cm_double(void* st) nogil: +cdef double pcg64_cm_double(void* st) noexcept nogil: return uint64_to_double(pcg64_cm_next64(st)) cdef class PCG64(BitGenerator): @@ -515,4 +515,3 @@ cdef class PCG64DXSM(BitGenerator): pcg64_cm_advance(&self.rng_state, np.PyArray_DATA(d)) self._reset_state_variables() return self - diff --git a/numpy/random/_philox.pyx b/numpy/random/_philox.pyx index e0c0504f6..e5353460c 100644 --- a/numpy/random/_philox.pyx +++ b/numpy/random/_philox.pyx @@ -36,8 +36,8 @@ cdef extern from 'src/philox/philox.h': ctypedef s_philox_state philox_state - uint64_t philox_next64(philox_state *state) nogil - uint32_t philox_next32(philox_state *state) nogil + uint64_t philox_next64(philox_state *state) noexcept nogil + uint32_t philox_next32(philox_state *state) noexcept nogil void philox_jump(philox_state *state) void philox_advance(uint64_t *step, philox_state *state) -- cgit v1.2.1