File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1
1
from ._wrapper import * # isort: skip # XXX: currently this prevents circular imports
2
2
from . import random
3
3
from ._binary_ufuncs import *
4
+ from ._detail ._index_tricks import *
4
5
from ._detail ._util import AxisError , UFuncTypeError
5
6
from ._dtypes import *
6
7
from ._getlimits import errstate , finfo , iinfo
16
17
nan = float ("nan" )
17
18
from math import pi # isort: skip
18
19
19
- from numpy import s_ # isort: skip
20
- from numpy import index_exp # isort: skip
21
-
22
20
False_ = asarray (False , bool_ )
23
21
True_ = asarray (True , bool_ )
Original file line number Diff line number Diff line change
1
+ """
2
+ Vendored objects from numpy.lib.index_tricks
3
+ """
4
+ __all__ = ["index_exp" , "s_" ]
5
+
6
+
7
+ class IndexExpression :
8
+ """
9
+ Written by Konrad Hinsen <[email protected] >
10
+ last revision: 1999-7-23
11
+
12
+ Cosmetic changes by T. Oliphant 2001
13
+ """
14
+
15
+ def __init__ (self , maketuple ):
16
+ self .maketuple = maketuple
17
+
18
+ def __getitem__ (self , item ):
19
+ if self .maketuple and not isinstance (item , tuple ):
20
+ return (item ,)
21
+ else :
22
+ return item
23
+
24
+
25
+ index_exp = IndexExpression (maketuple = True )
26
+ s_ = IndexExpression (maketuple = False )
You can’t perform that action at this time.
0 commit comments