umath.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. """
  2. Create the numpy._core.umath namespace for backward compatibility. In v1.16
  3. the multiarray and umath c-extension modules were merged into a single
  4. _multiarray_umath extension module. So we replicate the old namespace
  5. by importing from the extension module.
  6. """
  7. import numpy
  8. from . import _multiarray_umath
  9. from ._multiarray_umath import *
  10. # These imports are needed for backward compatibility,
  11. # do not change them. issue gh-11862
  12. # _ones_like is semi-public, on purpose not added to __all__
  13. # These imports are needed for the strip & replace implementations
  14. from ._multiarray_umath import (
  15. _UFUNC_API,
  16. _add_newdoc_ufunc,
  17. _center,
  18. _expandtabs,
  19. _expandtabs_length,
  20. _extobj_contextvar,
  21. _get_extobj_dict,
  22. _ljust,
  23. _lstrip_chars,
  24. _lstrip_whitespace,
  25. _make_extobj,
  26. _ones_like,
  27. _partition,
  28. _partition_index,
  29. _replace,
  30. _rjust,
  31. _rpartition,
  32. _rpartition_index,
  33. _rstrip_chars,
  34. _rstrip_whitespace,
  35. _slice,
  36. _strip_chars,
  37. _strip_whitespace,
  38. _zfill,
  39. )
  40. __all__ = [
  41. 'absolute', 'add',
  42. 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh',
  43. 'bitwise_and', 'bitwise_or', 'bitwise_xor', 'cbrt', 'ceil', 'conj',
  44. 'conjugate', 'copysign', 'cos', 'cosh', 'bitwise_count', 'deg2rad',
  45. 'degrees', 'divide', 'divmod', 'e', 'equal', 'euler_gamma', 'exp', 'exp2',
  46. 'expm1', 'fabs', 'floor', 'floor_divide', 'float_power', 'fmax', 'fmin',
  47. 'fmod', 'frexp', 'frompyfunc', 'gcd', 'greater', 'greater_equal',
  48. 'heaviside', 'hypot', 'invert', 'isfinite', 'isinf', 'isnan', 'isnat',
  49. 'lcm', 'ldexp', 'left_shift', 'less', 'less_equal', 'log', 'log10',
  50. 'log1p', 'log2', 'logaddexp', 'logaddexp2', 'logical_and', 'logical_not',
  51. 'logical_or', 'logical_xor', 'matmul', 'matvec', 'maximum', 'minimum', 'mod',
  52. 'modf', 'multiply', 'negative', 'nextafter', 'not_equal', 'pi', 'positive',
  53. 'power', 'rad2deg', 'radians', 'reciprocal', 'remainder', 'right_shift',
  54. 'rint', 'sign', 'signbit', 'sin', 'sinh', 'spacing', 'sqrt', 'square',
  55. 'subtract', 'tan', 'tanh', 'true_divide', 'trunc', 'vecdot', 'vecmat']