zeros.py 1008 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 _zeros_py
  6. __all__ = [ # noqa: F822
  7. 'CONVERGED',
  8. 'CONVERR',
  9. 'INPROGRESS',
  10. 'RootResults',
  11. 'SIGNERR',
  12. 'TOMS748Solver',
  13. 'VALUEERR',
  14. 'bisect',
  15. 'brenth',
  16. 'brentq',
  17. 'flag_map',
  18. 'namedtuple',
  19. 'newton',
  20. 'operator',
  21. 'results_c',
  22. 'ridder',
  23. 'toms748',
  24. ]
  25. def __dir__():
  26. return __all__
  27. def __getattr__(name):
  28. if name not in __all__:
  29. raise AttributeError(
  30. "scipy.optimize.zeros is deprecated and has no attribute "
  31. f"{name}. Try looking in scipy.optimize instead.")
  32. warnings.warn(f"Please use `{name}` from the `scipy.optimize` namespace, "
  33. "the `scipy.optimize.zeros` namespace is deprecated.",
  34. category=DeprecationWarning, stacklevel=2)
  35. return getattr(_zeros_py, name)