Skip to content

Commit 448bd67

Browse files
Merge pull request #18 from nauaneed/bump-cython-old
Bump Cython Old
2 parents 8606cdc + c7c2068 commit 448bd67

File tree

10 files changed

+498
-387
lines changed

10 files changed

+498
-387
lines changed

.github/workflows/tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,13 @@ jobs:
2323
python -m pip install -r requirements.txt
2424
pip install .
2525
- name: Run tests
26-
run: pytest -v --pyargs cyarray
26+
run: pytest -v --pyargs cyarray --benchmark-save benchmark-stats --benchmark-json benchmark-full.json --benchmark-histogram
27+
28+
- name: 'Upload Perf Data'
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: perf-bench-result-${{ matrix.python-version }}-${{ matrix.os }}
32+
path: |
33+
benchmark_*.svg
34+
.benchmarks/*
35+
benchmark-full.json

cyarray/carray.pxd

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Declaration File.
1212
# numpy import
1313
cimport numpy as np
1414

15-
cdef long aligned(long n, int item_size) nogil
16-
cdef void* aligned_malloc(size_t bytes) nogil
17-
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) nogil
18-
cdef void aligned_free(void* p) nogil
15+
cdef long aligned(long n, int item_size) noexcept nogil
16+
cdef void* aligned_malloc(size_t bytes) noexcept nogil
17+
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) noexcept nogil
18+
cdef void aligned_free(void* p) noexcept nogil
1919

2020
# forward declaration
2121
cdef class BaseArray
@@ -30,11 +30,11 @@ cdef class BaseArray:
3030
cdef public long length, alloc
3131
cdef np.ndarray _npy_array
3232

33-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
34-
cdef void c_reserve(self, long size) nogil
35-
cdef void c_reset(self) nogil
36-
cdef void c_resize(self, long size) nogil
37-
cdef void c_squeeze(self) nogil
33+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
34+
cdef void c_reserve(self, long size) noexcept nogil
35+
cdef void c_reset(self) noexcept nogil
36+
cdef void c_resize(self, long size) noexcept nogil
37+
cdef void c_squeeze(self) noexcept nogil
3838

3939
cpdef reserve(self, long size)
4040
cpdef resize(self, long size)
@@ -62,9 +62,9 @@ cdef class IntArray(BaseArray):
6262
cdef IntArray _parent
6363

6464
cdef _setup_npy_array(self)
65-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
66-
cdef void c_append(self, int value) nogil
67-
cdef void c_set_view(self, int *array, long length) nogil
65+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
66+
cdef void c_append(self, int value) noexcept nogil
67+
cdef void c_set_view(self, int *array, long length) noexcept nogil
6868
cdef int* get_data_ptr(self)
6969

7070
cpdef int get(self, long idx)
@@ -92,9 +92,9 @@ cdef class UIntArray(BaseArray):
9292
cdef UIntArray _parent
9393

9494
cdef _setup_npy_array(self)
95-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
96-
cdef void c_append(self, unsigned int value) nogil
97-
cdef void c_set_view(self, unsigned int *array, long length) nogil
95+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
96+
cdef void c_append(self, unsigned int value) noexcept nogil
97+
cdef void c_set_view(self, unsigned int *array, long length) noexcept nogil
9898
cdef unsigned int* get_data_ptr(self)
9999

100100
cpdef unsigned int get(self, long idx)
@@ -122,9 +122,9 @@ cdef class LongArray(BaseArray):
122122
cdef LongArray _parent
123123

124124
cdef _setup_npy_array(self)
125-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
126-
cdef void c_append(self, long value) nogil
127-
cdef void c_set_view(self, long *array, long length) nogil
125+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
126+
cdef void c_append(self, long value) noexcept nogil
127+
cdef void c_set_view(self, long *array, long length) noexcept nogil
128128
cdef long* get_data_ptr(self)
129129

130130
cpdef long get(self, long idx)
@@ -152,9 +152,9 @@ cdef class FloatArray(BaseArray):
152152
cdef FloatArray _parent
153153

154154
cdef _setup_npy_array(self)
155-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
156-
cdef void c_append(self, float value) nogil
157-
cdef void c_set_view(self, float *array, long length) nogil
155+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
156+
cdef void c_append(self, float value) noexcept nogil
157+
cdef void c_set_view(self, float *array, long length) noexcept nogil
158158
cdef float* get_data_ptr(self)
159159

160160
cpdef float get(self, long idx)
@@ -182,9 +182,9 @@ cdef class DoubleArray(BaseArray):
182182
cdef DoubleArray _parent
183183

184184
cdef _setup_npy_array(self)
185-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
186-
cdef void c_append(self, double value) nogil
187-
cdef void c_set_view(self, double *array, long length) nogil
185+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
186+
cdef void c_append(self, double value) noexcept nogil
187+
cdef void c_set_view(self, double *array, long length) noexcept nogil
188188
cdef double* get_data_ptr(self)
189189

190190
cpdef double get(self, long idx)

cyarray/carray.pxd.mako

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Declaration File.
2020
# numpy import
2121
cimport numpy as np
2222

23-
cdef long aligned(long n, int item_size) nogil
24-
cdef void* aligned_malloc(size_t bytes) nogil
25-
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) nogil
26-
cdef void aligned_free(void* p) nogil
23+
cdef long aligned(long n, int item_size) noexcept nogil
24+
cdef void* aligned_malloc(size_t bytes) noexcept nogil
25+
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) noexcept nogil
26+
cdef void aligned_free(void* p) noexcept nogil
2727

2828
# forward declaration
2929
cdef class BaseArray
@@ -38,11 +38,11 @@ cdef class BaseArray:
3838
cdef public long length, alloc
3939
cdef np.ndarray _npy_array
4040

41-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
42-
cdef void c_reserve(self, long size) nogil
43-
cdef void c_reset(self) nogil
44-
cdef void c_resize(self, long size) nogil
45-
cdef void c_squeeze(self) nogil
41+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
42+
cdef void c_reserve(self, long size) noexcept nogil
43+
cdef void c_reset(self) noexcept nogil
44+
cdef void c_resize(self, long size) noexcept nogil
45+
cdef void c_squeeze(self) noexcept nogil
4646

4747
cpdef reserve(self, long size)
4848
cpdef resize(self, long size)
@@ -71,9 +71,9 @@ cdef class ${CLASSNAME}(BaseArray):
7171
cdef ${CLASSNAME} _parent
7272

7373
cdef _setup_npy_array(self)
74-
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
75-
cdef void c_append(self, ${ARRAY_TYPE} value) nogil
76-
cdef void c_set_view(self, ${ARRAY_TYPE} *array, long length) nogil
74+
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
75+
cdef void c_append(self, ${ARRAY_TYPE} value) noexcept nogil
76+
cdef void c_set_view(self, ${ARRAY_TYPE} *array, long length) noexcept nogil
7777
cdef ${ARRAY_TYPE}* get_data_ptr(self)
7878

7979
cpdef ${ARRAY_TYPE} get(self, long idx)

0 commit comments

Comments
 (0)