common.py 869 B

1234567891011121314151617181920212223242526272829
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.datasets` namespace for importing the dataset functions
  3. # included below.
  4. import warnings
  5. from . import _common
  6. __all__ = [ # noqa: F822
  7. 'central_diff_weights', 'derivative', 'ascent', 'face',
  8. 'electrocardiogram', 'arange', 'newaxis', 'hstack', 'prod', 'array', 'load'
  9. ]
  10. def __dir__():
  11. return __all__
  12. def __getattr__(name):
  13. if name not in __all__:
  14. raise AttributeError(
  15. "scipy.misc.common is deprecated and has no attribute "
  16. f"{name}. Try looking in scipy.datasets instead.")
  17. warnings.warn(f"Please use `{name}` from the `scipy.misc` namespace, "
  18. "the `scipy.misc.common` namespace is deprecated.",
  19. category=DeprecationWarning, stacklevel=2)
  20. return getattr(_common, name)