function_base.pyi 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. from typing import (
  2. Literal as L,
  3. overload,
  4. Any,
  5. SupportsIndex,
  6. TypeVar,
  7. )
  8. from numpy import floating, complexfloating, generic
  9. from numpy._typing import (
  10. NDArray,
  11. DTypeLike,
  12. _DTypeLike,
  13. _ArrayLikeFloat_co,
  14. _ArrayLikeComplex_co,
  15. )
  16. _SCT = TypeVar("_SCT", bound=generic)
  17. __all__: list[str]
  18. @overload
  19. def linspace(
  20. start: _ArrayLikeFloat_co,
  21. stop: _ArrayLikeFloat_co,
  22. num: SupportsIndex = ...,
  23. endpoint: bool = ...,
  24. retstep: L[False] = ...,
  25. dtype: None = ...,
  26. axis: SupportsIndex = ...,
  27. ) -> NDArray[floating[Any]]: ...
  28. @overload
  29. def linspace(
  30. start: _ArrayLikeComplex_co,
  31. stop: _ArrayLikeComplex_co,
  32. num: SupportsIndex = ...,
  33. endpoint: bool = ...,
  34. retstep: L[False] = ...,
  35. dtype: None = ...,
  36. axis: SupportsIndex = ...,
  37. ) -> NDArray[complexfloating[Any, Any]]: ...
  38. @overload
  39. def linspace(
  40. start: _ArrayLikeComplex_co,
  41. stop: _ArrayLikeComplex_co,
  42. num: SupportsIndex = ...,
  43. endpoint: bool = ...,
  44. retstep: L[False] = ...,
  45. dtype: _DTypeLike[_SCT] = ...,
  46. axis: SupportsIndex = ...,
  47. ) -> NDArray[_SCT]: ...
  48. @overload
  49. def linspace(
  50. start: _ArrayLikeComplex_co,
  51. stop: _ArrayLikeComplex_co,
  52. num: SupportsIndex = ...,
  53. endpoint: bool = ...,
  54. retstep: L[False] = ...,
  55. dtype: DTypeLike = ...,
  56. axis: SupportsIndex = ...,
  57. ) -> NDArray[Any]: ...
  58. @overload
  59. def linspace(
  60. start: _ArrayLikeFloat_co,
  61. stop: _ArrayLikeFloat_co,
  62. num: SupportsIndex = ...,
  63. endpoint: bool = ...,
  64. retstep: L[True] = ...,
  65. dtype: None = ...,
  66. axis: SupportsIndex = ...,
  67. ) -> tuple[NDArray[floating[Any]], floating[Any]]: ...
  68. @overload
  69. def linspace(
  70. start: _ArrayLikeComplex_co,
  71. stop: _ArrayLikeComplex_co,
  72. num: SupportsIndex = ...,
  73. endpoint: bool = ...,
  74. retstep: L[True] = ...,
  75. dtype: None = ...,
  76. axis: SupportsIndex = ...,
  77. ) -> tuple[NDArray[complexfloating[Any, Any]], complexfloating[Any, Any]]: ...
  78. @overload
  79. def linspace(
  80. start: _ArrayLikeComplex_co,
  81. stop: _ArrayLikeComplex_co,
  82. num: SupportsIndex = ...,
  83. endpoint: bool = ...,
  84. retstep: L[True] = ...,
  85. dtype: _DTypeLike[_SCT] = ...,
  86. axis: SupportsIndex = ...,
  87. ) -> tuple[NDArray[_SCT], _SCT]: ...
  88. @overload
  89. def linspace(
  90. start: _ArrayLikeComplex_co,
  91. stop: _ArrayLikeComplex_co,
  92. num: SupportsIndex = ...,
  93. endpoint: bool = ...,
  94. retstep: L[True] = ...,
  95. dtype: DTypeLike = ...,
  96. axis: SupportsIndex = ...,
  97. ) -> tuple[NDArray[Any], Any]: ...
  98. @overload
  99. def logspace(
  100. start: _ArrayLikeFloat_co,
  101. stop: _ArrayLikeFloat_co,
  102. num: SupportsIndex = ...,
  103. endpoint: bool = ...,
  104. base: _ArrayLikeFloat_co = ...,
  105. dtype: None = ...,
  106. axis: SupportsIndex = ...,
  107. ) -> NDArray[floating[Any]]: ...
  108. @overload
  109. def logspace(
  110. start: _ArrayLikeComplex_co,
  111. stop: _ArrayLikeComplex_co,
  112. num: SupportsIndex = ...,
  113. endpoint: bool = ...,
  114. base: _ArrayLikeComplex_co = ...,
  115. dtype: None = ...,
  116. axis: SupportsIndex = ...,
  117. ) -> NDArray[complexfloating[Any, Any]]: ...
  118. @overload
  119. def logspace(
  120. start: _ArrayLikeComplex_co,
  121. stop: _ArrayLikeComplex_co,
  122. num: SupportsIndex = ...,
  123. endpoint: bool = ...,
  124. base: _ArrayLikeComplex_co = ...,
  125. dtype: _DTypeLike[_SCT] = ...,
  126. axis: SupportsIndex = ...,
  127. ) -> NDArray[_SCT]: ...
  128. @overload
  129. def logspace(
  130. start: _ArrayLikeComplex_co,
  131. stop: _ArrayLikeComplex_co,
  132. num: SupportsIndex = ...,
  133. endpoint: bool = ...,
  134. base: _ArrayLikeComplex_co = ...,
  135. dtype: DTypeLike = ...,
  136. axis: SupportsIndex = ...,
  137. ) -> NDArray[Any]: ...
  138. @overload
  139. def geomspace(
  140. start: _ArrayLikeFloat_co,
  141. stop: _ArrayLikeFloat_co,
  142. num: SupportsIndex = ...,
  143. endpoint: bool = ...,
  144. dtype: None = ...,
  145. axis: SupportsIndex = ...,
  146. ) -> NDArray[floating[Any]]: ...
  147. @overload
  148. def geomspace(
  149. start: _ArrayLikeComplex_co,
  150. stop: _ArrayLikeComplex_co,
  151. num: SupportsIndex = ...,
  152. endpoint: bool = ...,
  153. dtype: None = ...,
  154. axis: SupportsIndex = ...,
  155. ) -> NDArray[complexfloating[Any, Any]]: ...
  156. @overload
  157. def geomspace(
  158. start: _ArrayLikeComplex_co,
  159. stop: _ArrayLikeComplex_co,
  160. num: SupportsIndex = ...,
  161. endpoint: bool = ...,
  162. dtype: _DTypeLike[_SCT] = ...,
  163. axis: SupportsIndex = ...,
  164. ) -> NDArray[_SCT]: ...
  165. @overload
  166. def geomspace(
  167. start: _ArrayLikeComplex_co,
  168. stop: _ArrayLikeComplex_co,
  169. num: SupportsIndex = ...,
  170. endpoint: bool = ...,
  171. dtype: DTypeLike = ...,
  172. axis: SupportsIndex = ...,
  173. ) -> NDArray[Any]: ...
  174. # Re-exported to `np.lib.function_base`
  175. def add_newdoc(
  176. place: str,
  177. obj: str,
  178. doc: str | tuple[str, str] | list[tuple[str, str]],
  179. warn_on_python: bool = ...,
  180. ) -> None: ...