Skip to content

Commit

Permalink
call cython numpy import_array() in a few places
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Jul 9, 2024
1 parent 54019f7 commit b5390ab
Show file tree
Hide file tree
Showing 4 changed files with 1,372 additions and 1,367 deletions.
1 change: 1 addition & 0 deletions talib/_abstract.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cimport numpy as np
cimport _ta_lib as lib
# NOTE: _ta_check_success, MA_Type is defined in _common.pxi

np.import_array() # Initialize the NumPy C API

# lookup for TALIB input parameters which don't define expected price series inputs
__INPUT_PRICE_SERIES_DEFAULTS = {'price': 'close',
Expand Down
2 changes: 1 addition & 1 deletion talib/_stream.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ from cython import boundscheck, wraparound
cimport _ta_lib as lib
from _ta_lib cimport TA_RetCode
# NOTE: _ta_check_success, NaN are defined in common.pxi
# NumPy C API is initialize in _func.pxi

np.import_array() # Initialize the NumPy C API

@wraparound(False) # turn off relative indexing from end of lists
@boundscheck(False) # turn off bounds-checking for entire function
Expand Down
Loading

0 comments on commit b5390ab

Please sign in to comment.