Skip to content

Commit 11d131b

Browse files
committed
Update for numpy 2.3.0
1 parent 6fa8bc6 commit 11d131b

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
- [FIX]: Make sure this wrapper works with TA-Lib 0.6.1 and newer releases.
55

6+
0.5.5
7+
=====
8+
9+
- [FIX]: Fix for numpy 2.3.0, which removed the npy_1_7_deprecated_api
10+
611
0.5.4
712
=====
813

talib/_func.pxi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cdef np.ndarray check_array(np.ndarray real):
2222
raise Exception("input array type is not double")
2323
if real.ndim != 1:
2424
raise Exception("input array has wrong dimensions")
25-
if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS):
25+
if not (PyArray_FLAGS(real) & np.NPY_ARRAY_C_CONTIGUOUS):
2626
real = PyArray_GETCONTIGUOUS(real)
2727
return real
2828

@@ -122,7 +122,7 @@ cdef np.ndarray make_double_array(np.npy_intp length, int lookback):
122122
cdef:
123123
np.ndarray outreal
124124
double* outreal_data
125-
outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT)
125+
outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_ARRAY_DEFAULT)
126126
outreal_data = <double*>outreal.data
127127
for i from 0 <= i < min(lookback, length):
128128
outreal_data[i] = NaN
@@ -132,7 +132,7 @@ cdef np.ndarray make_int_array(np.npy_intp length, int lookback):
132132
cdef:
133133
np.ndarray outinteger
134134
int* outinteger_data
135-
outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT)
135+
outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_ARRAY_DEFAULT)
136136
outinteger_data = <int*>outinteger.data
137137
for i from 0 <= i < min(lookback, length):
138138
outinteger_data[i] = 0

talib/_ta_lib.c

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/generate_func.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
raise Exception("input array type is not double")
7474
if real.ndim != 1:
7575
raise Exception("input array has wrong dimensions")
76-
if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS):
76+
if not (PyArray_FLAGS(real) & np.NPY_ARRAY_C_CONTIGUOUS):
7777
real = PyArray_GETCONTIGUOUS(real)
7878
return real
7979
@@ -173,7 +173,7 @@
173173
cdef:
174174
np.ndarray outreal
175175
double* outreal_data
176-
outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT)
176+
outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_ARRAY_DEFAULT)
177177
outreal_data = <double*>outreal.data
178178
for i from 0 <= i < min(lookback, length):
179179
outreal_data[i] = NaN
@@ -183,7 +183,7 @@
183183
cdef:
184184
np.ndarray outinteger
185185
int* outinteger_data
186-
outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT)
186+
outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_ARRAY_DEFAULT)
187187
outinteger_data = <int*>outinteger.data
188188
for i from 0 <= i < min(lookback, length):
189189
outinteger_data[i] = 0

0 commit comments

Comments
 (0)