minpack.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.optimize` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _minpack_py
  6. __all__ = [ # noqa: F822
  7. 'LEASTSQ_FAILURE',
  8. 'LEASTSQ_SUCCESS',
  9. 'LinAlgError',
  10. 'OptimizeResult',
  11. 'OptimizeWarning',
  12. 'asarray',
  13. 'atleast_1d',
  14. 'check_gradient',
  15. 'cholesky',
  16. 'curve_fit',
  17. 'dot',
  18. 'dtype',
  19. 'error',
  20. 'eye',
  21. 'finfo',
  22. 'fixed_point',
  23. 'fsolve',
  24. 'greater',
  25. 'inexact',
  26. 'inf',
  27. 'inv',
  28. 'issubdtype',
  29. 'least_squares',
  30. 'leastsq',
  31. 'prepare_bounds',
  32. 'prod',
  33. 'shape',
  34. 'solve_triangular',
  35. 'svd',
  36. 'take',
  37. 'transpose',
  38. 'triu',
  39. 'zeros',
  40. ]
  41. def __dir__():
  42. return __all__
  43. def __getattr__(name):
  44. if name not in __all__:
  45. raise AttributeError(
  46. "scipy.optimize.minpack is deprecated and has no attribute "
  47. f"{name}. Try looking in scipy.optimize instead.")
  48. warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, "
  49. "the `scipy.optimize.minpack` namespace is deprecated.",
  50. category=DeprecationWarning, stacklevel=2)
  51. return getattr(_minpack_py, name)