umath.pyi 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. import contextvars
  2. from _typeshed import SupportsWrite
  3. from collections.abc import Callable
  4. from typing import Any, Final, Literal, TypeAlias, TypedDict, Unpack, type_check_only
  5. from typing_extensions import CapsuleType
  6. from numpy import (
  7. absolute,
  8. add,
  9. arccos,
  10. arccosh,
  11. arcsin,
  12. arcsinh,
  13. arctan,
  14. arctan2,
  15. arctanh,
  16. bitwise_and,
  17. bitwise_count,
  18. bitwise_or,
  19. bitwise_xor,
  20. cbrt,
  21. ceil,
  22. conj,
  23. conjugate,
  24. copysign,
  25. cos,
  26. cosh,
  27. deg2rad,
  28. degrees,
  29. divide,
  30. divmod,
  31. e,
  32. equal,
  33. euler_gamma,
  34. exp,
  35. exp2,
  36. expm1,
  37. fabs,
  38. float_power,
  39. floor,
  40. floor_divide,
  41. fmax,
  42. fmin,
  43. fmod,
  44. frexp,
  45. frompyfunc,
  46. gcd,
  47. greater,
  48. greater_equal,
  49. heaviside,
  50. hypot,
  51. invert,
  52. isfinite,
  53. isinf,
  54. isnan,
  55. isnat,
  56. lcm,
  57. ldexp,
  58. left_shift,
  59. less,
  60. less_equal,
  61. log,
  62. log1p,
  63. log2,
  64. log10,
  65. logaddexp,
  66. logaddexp2,
  67. logical_and,
  68. logical_not,
  69. logical_or,
  70. logical_xor,
  71. matmul,
  72. matvec,
  73. maximum,
  74. minimum,
  75. mod,
  76. modf,
  77. multiply,
  78. negative,
  79. nextafter,
  80. not_equal,
  81. pi,
  82. positive,
  83. power,
  84. rad2deg,
  85. radians,
  86. reciprocal,
  87. remainder,
  88. right_shift,
  89. rint,
  90. sign,
  91. signbit,
  92. sin,
  93. sinh,
  94. spacing,
  95. sqrt,
  96. square,
  97. subtract,
  98. tan,
  99. tanh,
  100. true_divide,
  101. trunc,
  102. vecdot,
  103. vecmat,
  104. )
  105. __all__ = [
  106. "absolute",
  107. "add",
  108. "arccos",
  109. "arccosh",
  110. "arcsin",
  111. "arcsinh",
  112. "arctan",
  113. "arctan2",
  114. "arctanh",
  115. "bitwise_and",
  116. "bitwise_count",
  117. "bitwise_or",
  118. "bitwise_xor",
  119. "cbrt",
  120. "ceil",
  121. "conj",
  122. "conjugate",
  123. "copysign",
  124. "cos",
  125. "cosh",
  126. "deg2rad",
  127. "degrees",
  128. "divide",
  129. "divmod",
  130. "e",
  131. "equal",
  132. "euler_gamma",
  133. "exp",
  134. "exp2",
  135. "expm1",
  136. "fabs",
  137. "float_power",
  138. "floor",
  139. "floor_divide",
  140. "fmax",
  141. "fmin",
  142. "fmod",
  143. "frexp",
  144. "frompyfunc",
  145. "gcd",
  146. "greater",
  147. "greater_equal",
  148. "heaviside",
  149. "hypot",
  150. "invert",
  151. "isfinite",
  152. "isinf",
  153. "isnan",
  154. "isnat",
  155. "lcm",
  156. "ldexp",
  157. "left_shift",
  158. "less",
  159. "less_equal",
  160. "log",
  161. "log1p",
  162. "log2",
  163. "log10",
  164. "logaddexp",
  165. "logaddexp2",
  166. "logical_and",
  167. "logical_not",
  168. "logical_or",
  169. "logical_xor",
  170. "matmul",
  171. "matvec",
  172. "maximum",
  173. "minimum",
  174. "mod",
  175. "modf",
  176. "multiply",
  177. "negative",
  178. "nextafter",
  179. "not_equal",
  180. "pi",
  181. "positive",
  182. "power",
  183. "rad2deg",
  184. "radians",
  185. "reciprocal",
  186. "remainder",
  187. "right_shift",
  188. "rint",
  189. "sign",
  190. "signbit",
  191. "sin",
  192. "sinh",
  193. "spacing",
  194. "sqrt",
  195. "square",
  196. "subtract",
  197. "tan",
  198. "tanh",
  199. "true_divide",
  200. "trunc",
  201. "vecdot",
  202. "vecmat",
  203. ]
  204. ###
  205. _ErrKind: TypeAlias = Literal["ignore", "warn", "raise", "call", "print", "log"]
  206. _ErrCall: TypeAlias = Callable[[str, int], Any] | SupportsWrite[str]
  207. @type_check_only
  208. class _ExtOjbDict(TypedDict, total=False):
  209. divide: _ErrKind
  210. over: _ErrKind
  211. under: _ErrKind
  212. invalid: _ErrKind
  213. call: _ErrCall | None
  214. bufsize: int
  215. # re-exports from `_core._multiarray_umath` that are used by `_core._ufunc_config`
  216. NAN: Final[float] = float("nan")
  217. PINF: Final[float] = float("+inf")
  218. NINF: Final[float] = float("-inf")
  219. PZERO: Final[float] = +0.0
  220. NZERO: Final[float] = -0.0
  221. _UFUNC_API: Final[CapsuleType] = ...
  222. _extobj_contextvar: Final[contextvars.ContextVar[CapsuleType]] = ...
  223. def _get_extobj_dict() -> _ExtOjbDict: ...
  224. def _make_extobj(*, all: _ErrKind = ..., **kwargs: Unpack[_ExtOjbDict]) -> CapsuleType: ...