lbfgsb.py 929 B

12345678910111213141516171819202122232425262728293031323334353637
  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 _lbfgsb_py
  6. __all__ = [ # noqa: F822
  7. 'LbfgsInvHessProduct',
  8. 'LinearOperator',
  9. 'MemoizeJac',
  10. 'OptimizeResult',
  11. 'array',
  12. 'asarray',
  13. 'float64',
  14. 'fmin_l_bfgs_b',
  15. 'old_bound_to_new',
  16. 'zeros',
  17. ]
  18. def __dir__():
  19. return __all__
  20. def __getattr__(name):
  21. if name not in __all__:
  22. raise AttributeError(
  23. "scipy.optimize.lbfgsb is deprecated and has no attribute "
  24. f"{name}. Try looking in scipy.optimize instead.")
  25. warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, "
  26. "the `scipy.optimize.lbfgsb` namespace is deprecated.",
  27. category=DeprecationWarning, stacklevel=2)
  28. return getattr(_lbfgsb_py, name)