slsqp.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 _slsqp_py
  6. __all__ = [ # noqa: F822
  7. 'OptimizeResult',
  8. 'append',
  9. 'approx_derivative',
  10. 'approx_jacobian',
  11. 'array',
  12. 'asfarray',
  13. 'atleast_1d',
  14. 'concatenate',
  15. 'exp',
  16. 'finfo',
  17. 'fmin_slsqp',
  18. 'inf',
  19. 'isfinite',
  20. 'linalg',
  21. 'old_bound_to_new',
  22. 'slsqp',
  23. 'sqrt',
  24. 'vstack',
  25. 'zeros',
  26. ]
  27. def __dir__():
  28. return __all__
  29. def __getattr__(name):
  30. if name not in __all__:
  31. raise AttributeError(
  32. "scipy.optimize.slsqp is deprecated and has no attribute "
  33. f"{name}. Try looking in scipy.optimize instead.")
  34. warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, "
  35. "the `scipy.optimize.slsqp` namespace is deprecated.",
  36. category=DeprecationWarning, stacklevel=2)
  37. return getattr(_slsqp_py, name)