|
1 | 1 | from __future__ import annotations |
| 2 | +from functools import partial |
2 | 3 |
|
3 | 4 | from ...common import _aliases |
4 | 5 | from ...common._helpers import _check_device |
5 | 6 |
|
6 | 7 | from ..._internal import get_xp |
7 | 8 |
|
8 | 9 | import numpy as np |
9 | | -from numpy import ( |
10 | | - # Constants |
11 | | - e, |
12 | | - inf, |
13 | | - nan, |
14 | | - pi, |
15 | | - newaxis, |
16 | | - # Dtypes |
17 | | - bool_ as bool, |
18 | | - float32, |
19 | | - float64, |
20 | | - int8, |
21 | | - int16, |
22 | | - int32, |
23 | | - int64, |
24 | | - uint8, |
25 | | - uint16, |
26 | | - uint32, |
27 | | - uint64, |
28 | | - complex64, |
29 | | - complex128, |
30 | | - iinfo, |
31 | | - finfo, |
32 | | - can_cast, |
33 | | - result_type, |
34 | | -) |
35 | 10 |
|
36 | 11 | from typing import TYPE_CHECKING |
37 | 12 | if TYPE_CHECKING: |
@@ -75,7 +50,6 @@ def dask_arange( |
75 | 50 | arange = get_xp(da)(dask_arange) |
76 | 51 | eye = get_xp(da)(_aliases.eye) |
77 | 52 |
|
78 | | -from functools import partial |
79 | 53 | asarray = partial(_aliases._asarray, namespace='dask.array') |
80 | 54 | asarray.__doc__ = _aliases._asarray.__doc__ |
81 | 55 |
|
@@ -112,34 +86,3 @@ def dask_arange( |
112 | 86 | matmul = get_xp(np)(_aliases.matmul) |
113 | 87 | tensordot = get_xp(np)(_aliases.tensordot) |
114 | 88 |
|
115 | | -from dask.array import ( |
116 | | - # Element wise aliases |
117 | | - arccos as acos, |
118 | | - arccosh as acosh, |
119 | | - arcsin as asin, |
120 | | - arcsinh as asinh, |
121 | | - arctan as atan, |
122 | | - arctan2 as atan2, |
123 | | - arctanh as atanh, |
124 | | - left_shift as bitwise_left_shift, |
125 | | - right_shift as bitwise_right_shift, |
126 | | - invert as bitwise_invert, |
127 | | - power as pow, |
128 | | - # Other |
129 | | - concatenate as concat, |
130 | | -) |
131 | | - |
132 | | -# exclude these from all since |
133 | | -_da_unsupported = ['sort', 'argsort'] |
134 | | - |
135 | | -common_aliases = [alias for alias in _aliases.__all__ if alias not in _da_unsupported] |
136 | | - |
137 | | -__all__ = common_aliases + ['asarray', 'bool', 'acos', |
138 | | - 'acosh', 'asin', 'asinh', 'atan', 'atan2', |
139 | | - 'atanh', 'bitwise_left_shift', 'bitwise_invert', |
140 | | - 'bitwise_right_shift', 'concat', 'pow', |
141 | | - 'e', 'inf', 'nan', 'pi', 'newaxis', 'float32', 'float64', 'int8', |
142 | | - 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64', |
143 | | - 'complex64', 'complex128', 'iinfo', 'finfo', 'can_cast', 'result_type'] |
144 | | - |
145 | | -del da, partial, common_aliases, _da_unsupported, |
0 commit comments