cobyla.py 840 B

12345678910111213141516171819202122232425262728293031
  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 _cobyla_py
  6. __all__ = [ # noqa: F822
  7. 'OptimizeResult',
  8. 'RLock',
  9. 'fmin_cobyla',
  10. 'functools',
  11. 'izip',
  12. 'synchronized',
  13. ]
  14. def __dir__():
  15. return __all__
  16. def __getattr__(name):
  17. if name not in __all__:
  18. raise AttributeError(
  19. "scipy.optimize.cobyla is deprecated and has no attribute "
  20. f"{name}. Try looking in scipy.optimize instead.")
  21. warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, "
  22. "the `scipy.optimize.cobyla` namespace is deprecated.",
  23. category=DeprecationWarning, stacklevel=2)
  24. return getattr(_cobyla_py, name)