interpolate.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.interpolate` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _interpolate
  6. __all__ = [ # noqa: F822
  7. 'BPoly',
  8. 'BSpline',
  9. 'NdPPoly',
  10. 'PPoly',
  11. 'RectBivariateSpline',
  12. 'RegularGridInterpolator',
  13. 'array',
  14. 'asarray',
  15. 'atleast_1d',
  16. 'atleast_2d',
  17. 'comb',
  18. 'dfitpack',
  19. 'interp1d',
  20. 'interp2d',
  21. 'interpn',
  22. 'intp',
  23. 'itertools',
  24. 'lagrange',
  25. 'make_interp_spline',
  26. 'poly1d',
  27. 'prod',
  28. 'ravel',
  29. 'searchsorted',
  30. 'spec',
  31. 'transpose',
  32. ]
  33. def __dir__():
  34. return __all__
  35. def __getattr__(name):
  36. if name not in __all__:
  37. raise AttributeError(
  38. "scipy.interpolate.interpolate is deprecated and has no attribute "
  39. f"{name}. Try looking in scipy.interpolate instead.")
  40. warnings.warn(f"Please use `{name}` from the `scipy.interpolate` namespace, "
  41. "the `scipy.interpolate.interpolate` namespace is deprecated.",
  42. category=DeprecationWarning, stacklevel=2)
  43. return getattr(_interpolate, name)