File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change 1
1
from functools import wraps
2
+ import warnings
2
3
import numpy as np
3
4
from astropy import log
4
5
from collections .abc import Iterable as iterable
9
10
from numba import types
10
11
from numba .extending import overload_method
11
12
12
- @overload_method (types .Array , "take" ) # pragma: no cover
13
- def array_take (arr , indices ):
14
- """Adapt np.take to arrays"""
15
- if isinstance (indices , types .Array ):
16
-
17
- def take_impl (arr , indices ):
18
- n = indices .shape [0 ]
19
- res = np .empty (n , arr .dtype )
20
- for i in range (n ):
21
- res [i ] = arr [indices [i ]]
22
- return res
23
-
24
- return take_impl
25
-
26
13
HAS_NUMBA = True
27
14
except ImportError :
28
15
HAS_NUMBA = False
@@ -57,6 +44,8 @@ def __call__(self, func):
57
44
58
45
float32 = float64 = int32 = int64 = lambda x , y : None
59
46
60
- def array_take (arr , indices ):
61
- """Adapt np.take to arrays"""
62
- return np .take (arr , indices )
47
+
48
+ def array_take (arr , indices ): # pragma: no cover
49
+ """Adapt np.take to arrays"""
50
+ warnings .warn ("array_take is deprecated. Use np.take instead, also with Numba." )
51
+ return np .take (arr , indices )
You can’t perform that action at this time.
0 commit comments