Skip to content

Bump Cython Old #18

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 8 commits into from
Aug 18, 2024
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
11 changes: 10 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@ jobs:
python -m pip install -r requirements.txt
pip install .
- name: Run tests
run: pytest -v --pyargs cyarray
run: pytest -v --pyargs cyarray --benchmark-save benchmark-stats --benchmark-json benchmark-full.json --benchmark-histogram

- name: 'Upload Perf Data'
uses: actions/upload-artifact@v4
with:
name: perf-bench-result-${{ matrix.python-version }}-${{ matrix.os }}
path: |
benchmark_*.svg
.benchmarks/*
benchmark-full.json
48 changes: 24 additions & 24 deletions cyarray/carray.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Declaration File.
# numpy import
cimport numpy as np

cdef long aligned(long n, int item_size) nogil
cdef void* aligned_malloc(size_t bytes) nogil
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) nogil
cdef void aligned_free(void* p) nogil
cdef long aligned(long n, int item_size) noexcept nogil
cdef void* aligned_malloc(size_t bytes) noexcept nogil
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) noexcept nogil
cdef void aligned_free(void* p) noexcept nogil

# forward declaration
cdef class BaseArray
Expand All @@ -30,11 +30,11 @@ cdef class BaseArray:
cdef public long length, alloc
cdef np.ndarray _npy_array

cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_reserve(self, long size) nogil
cdef void c_reset(self) nogil
cdef void c_resize(self, long size) nogil
cdef void c_squeeze(self) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_reserve(self, long size) noexcept nogil
cdef void c_reset(self) noexcept nogil
cdef void c_resize(self, long size) noexcept nogil
cdef void c_squeeze(self) noexcept nogil

cpdef reserve(self, long size)
cpdef resize(self, long size)
Expand Down Expand Up @@ -62,9 +62,9 @@ cdef class IntArray(BaseArray):
cdef IntArray _parent

cdef _setup_npy_array(self)
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_append(self, int value) nogil
cdef void c_set_view(self, int *array, long length) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_append(self, int value) noexcept nogil
cdef void c_set_view(self, int *array, long length) noexcept nogil
cdef int* get_data_ptr(self)

cpdef int get(self, long idx)
Expand Down Expand Up @@ -92,9 +92,9 @@ cdef class UIntArray(BaseArray):
cdef UIntArray _parent

cdef _setup_npy_array(self)
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_append(self, unsigned int value) nogil
cdef void c_set_view(self, unsigned int *array, long length) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_append(self, unsigned int value) noexcept nogil
cdef void c_set_view(self, unsigned int *array, long length) noexcept nogil
cdef unsigned int* get_data_ptr(self)

cpdef unsigned int get(self, long idx)
Expand Down Expand Up @@ -122,9 +122,9 @@ cdef class LongArray(BaseArray):
cdef LongArray _parent

cdef _setup_npy_array(self)
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_append(self, long value) nogil
cdef void c_set_view(self, long *array, long length) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_append(self, long value) noexcept nogil
cdef void c_set_view(self, long *array, long length) noexcept nogil
cdef long* get_data_ptr(self)

cpdef long get(self, long idx)
Expand Down Expand Up @@ -152,9 +152,9 @@ cdef class FloatArray(BaseArray):
cdef FloatArray _parent

cdef _setup_npy_array(self)
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_append(self, float value) nogil
cdef void c_set_view(self, float *array, long length) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_append(self, float value) noexcept nogil
cdef void c_set_view(self, float *array, long length) noexcept nogil
cdef float* get_data_ptr(self)

cpdef float get(self, long idx)
Expand Down Expand Up @@ -182,9 +182,9 @@ cdef class DoubleArray(BaseArray):
cdef DoubleArray _parent

cdef _setup_npy_array(self)
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_append(self, double value) nogil
cdef void c_set_view(self, double *array, long length) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_append(self, double value) noexcept nogil
cdef void c_set_view(self, double *array, long length) noexcept nogil
cdef double* get_data_ptr(self)

cpdef double get(self, long idx)
Expand Down
24 changes: 12 additions & 12 deletions cyarray/carray.pxd.mako
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Declaration File.
# numpy import
cimport numpy as np

cdef long aligned(long n, int item_size) nogil
cdef void* aligned_malloc(size_t bytes) nogil
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) nogil
cdef void aligned_free(void* p) nogil
cdef long aligned(long n, int item_size) noexcept nogil
cdef void* aligned_malloc(size_t bytes) noexcept nogil
cdef void* aligned_realloc(void* existing, size_t bytes, size_t old_size) noexcept nogil
cdef void aligned_free(void* p) noexcept nogil

# forward declaration
cdef class BaseArray
Expand All @@ -38,11 +38,11 @@ cdef class BaseArray:
cdef public long length, alloc
cdef np.ndarray _npy_array

cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_reserve(self, long size) nogil
cdef void c_reset(self) nogil
cdef void c_resize(self, long size) nogil
cdef void c_squeeze(self) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_reserve(self, long size) noexcept nogil
cdef void c_reset(self) noexcept nogil
cdef void c_resize(self, long size) noexcept nogil
cdef void c_squeeze(self) noexcept nogil

cpdef reserve(self, long size)
cpdef resize(self, long size)
Expand Down Expand Up @@ -71,9 +71,9 @@ cdef class ${CLASSNAME}(BaseArray):
cdef ${CLASSNAME} _parent

cdef _setup_npy_array(self)
cdef void c_align_array(self, LongArray new_indices, int stride=*) nogil
cdef void c_append(self, ${ARRAY_TYPE} value) nogil
cdef void c_set_view(self, ${ARRAY_TYPE} *array, long length) nogil
cdef void c_align_array(self, LongArray new_indices, int stride=*) noexcept nogil
cdef void c_append(self, ${ARRAY_TYPE} value) noexcept nogil
cdef void c_set_view(self, ${ARRAY_TYPE} *array, long length) noexcept nogil
cdef ${ARRAY_TYPE}* get_data_ptr(self)

cpdef ${ARRAY_TYPE} get(self, long idx)
Expand Down
Loading
Loading