tnc.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 _tnc
  6. __all__ = [ # noqa: F822
  7. 'CONSTANT',
  8. 'FCONVERGED',
  9. 'INFEASIBLE',
  10. 'LOCALMINIMUM',
  11. 'LSFAIL',
  12. 'MAXFUN',
  13. 'MSGS',
  14. 'MSG_ALL',
  15. 'MSG_EXIT',
  16. 'MSG_INFO',
  17. 'MSG_ITER',
  18. 'MSG_NONE',
  19. 'MSG_VERS',
  20. 'MemoizeJac',
  21. 'NOPROGRESS',
  22. 'OptimizeResult',
  23. 'RCSTRINGS',
  24. 'USERABORT',
  25. 'XCONVERGED',
  26. 'array',
  27. 'asfarray',
  28. 'fmin_tnc',
  29. 'inf',
  30. 'moduleTNC',
  31. 'old_bound_to_new',
  32. 'zeros',
  33. ]
  34. def __dir__():
  35. return __all__
  36. def __getattr__(name):
  37. if name not in __all__:
  38. raise AttributeError(
  39. "scipy.optimize.tnc is deprecated and has no attribute "
  40. f"{name}. Try looking in scipy.optimize instead.")
  41. warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, "
  42. "the `scipy.optimize.tnc` namespace is deprecated.",
  43. category=DeprecationWarning, stacklevel=2)
  44. return getattr(_tnc, name)