ckdtree.py 862 B

1234567891011121314151617181920212223242526272829303132333435
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.spatial` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _ckdtree
  6. __all__ = [ # noqa: F822
  7. 'cKDTree',
  8. 'cKDTreeNode',
  9. 'coo_entries',
  10. 'operator',
  11. 'ordered_pairs',
  12. 'os',
  13. 'scipy',
  14. 'threading',
  15. ]
  16. def __dir__():
  17. return __all__
  18. def __getattr__(name):
  19. if name not in __all__:
  20. raise AttributeError(
  21. "scipy.spatial.ckdtree is deprecated and has no attribute "
  22. f"{name}. Try looking in scipy.spatial instead.")
  23. warnings.warn(f"Please use `{name}` from the `scipy.spatial` namespace, "
  24. "the `scipy.spatial.ckdtree` namespace is deprecated.",
  25. category=DeprecationWarning, stacklevel=2)
  26. return getattr(_ckdtree, name)