special_matrices.py 1.0 KB

123456789101112131415161718192021222324252627282930
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.linalg` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _special_matrices
  6. __all__ = [ # noqa: F822
  7. 'tri', 'tril', 'triu', 'toeplitz', 'circulant', 'hankel',
  8. 'hadamard', 'leslie', 'kron', 'block_diag', 'companion',
  9. 'helmert', 'hilbert', 'invhilbert', 'pascal', 'invpascal', 'dft',
  10. 'fiedler', 'fiedler_companion', 'convolution_matrix', 'as_strided'
  11. ]
  12. def __dir__():
  13. return __all__
  14. def __getattr__(name):
  15. if name not in __all__:
  16. raise AttributeError(
  17. "scipy.linalg.special_matrices is deprecated and has no attribute "
  18. f"{name}. Try looking in scipy.linalg instead.")
  19. warnings.warn(f"Please use `{name}` from the `scipy.linalg` namespace, the"
  20. " `scipy.linalg.special_matrices` namespace is deprecated.",
  21. category=DeprecationWarning, stacklevel=2)
  22. return getattr(_special_matrices, name)