odrpack.py 828 B

12345678910111213141516171819202122232425262728
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.odr` namespace for importing the functions
  3. # included below.
  4. __all__ = [ # noqa: F822
  5. 'odr', 'OdrWarning', 'OdrError', 'OdrStop',
  6. 'Data', 'RealData', 'Model', 'Output', 'ODR',
  7. 'odr_error', 'odr_stop'
  8. ]
  9. def __dir__():
  10. return __all__
  11. def __getattr__(name):
  12. msg = ("`scipy.odr` is deprecated as of version 1.17.0 and will be removed in "
  13. "SciPy 1.19.0. Please use `https://pypi.org/project/odrpack/` instead.")
  14. if name not in __all__:
  15. raise AttributeError(
  16. f"`scipy.odr.odrpack` has no attribute {name}. In addition, {msg}")
  17. import warnings
  18. from . import _odrpack
  19. warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
  20. return getattr(_odrpack, name)