Skip to content

Commit

Permalink
feat(weighted_median): call 'numpy.import_array()' after cimport
Browse files Browse the repository at this point in the history
  • Loading branch information
ljgray committed Sep 26, 2024
1 parent d5cb01a commit a606465
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions caput/weighted_median.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ from MedianTree cimport Tree, Data
cimport numpy as np
cimport cython

# Required for numpy 2.0 compatibility
np.import_array()

# Define the fused types that can be used for the data or weights in the median routine
ctypedef fused data_t:
int
Expand Down

0 comments on commit a606465

Please sign in to comment.