linesearch.py 1007 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 _linesearch
  6. __all__ = [ # noqa: F822
  7. 'LineSearchWarning',
  8. 'line_search',
  9. 'line_search_BFGS',
  10. 'line_search_armijo',
  11. 'line_search_wolfe1',
  12. 'line_search_wolfe2',
  13. 'minpack2',
  14. 'scalar_search_armijo',
  15. 'scalar_search_wolfe1',
  16. 'scalar_search_wolfe2',
  17. 'warn',
  18. ]
  19. def __dir__():
  20. return __all__
  21. def __getattr__(name):
  22. if name not in __all__:
  23. raise AttributeError(
  24. "scipy.optimize.linesearch is deprecated and has no attribute "
  25. f"{name}. Try looking in scipy.optimize instead.")
  26. warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, "
  27. "the `scipy.optimize.linesearch` namespace is deprecated.",
  28. category=DeprecationWarning, stacklevel=2)
  29. return getattr(_linesearch, name)