Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/numpy/dual.py
7757 views
"""1.. deprecated:: 1.2023*This module is deprecated. Instead of importing functions from*4``numpy.dual``, *the functions should be imported directly from NumPy5or SciPy*.67Aliases for functions which may be accelerated by SciPy.89SciPy_ can be built to use accelerated or otherwise improved libraries10for FFTs, linear algebra, and special functions. This module allows11developers to transparently support these accelerated functions when12SciPy is available but still support users who have only installed13NumPy.1415.. _SciPy : https://www.scipy.org1617"""18import warnings192021warnings.warn('The module numpy.dual is deprecated. Instead of using dual, '22'use the functions directly from numpy or scipy.',23category=DeprecationWarning,24stacklevel=2)2526# This module should be used for functions both in numpy and scipy if27# you want to use the numpy version if available but the scipy version28# otherwise.29# Usage --- from numpy.dual import fft, inv3031__all__ = ['fft', 'ifft', 'fftn', 'ifftn', 'fft2', 'ifft2',32'norm', 'inv', 'svd', 'solve', 'det', 'eig', 'eigvals',33'eigh', 'eigvalsh', 'lstsq', 'pinv', 'cholesky', 'i0']3435import numpy.linalg as linpkg36import numpy.fft as fftpkg37from numpy.lib import i038import sys394041fft = fftpkg.fft42ifft = fftpkg.ifft43fftn = fftpkg.fftn44ifftn = fftpkg.ifftn45fft2 = fftpkg.fft246ifft2 = fftpkg.ifft24748norm = linpkg.norm49inv = linpkg.inv50svd = linpkg.svd51solve = linpkg.solve52det = linpkg.det53eig = linpkg.eig54eigvals = linpkg.eigvals55eigh = linpkg.eigh56eigvalsh = linpkg.eigvalsh57lstsq = linpkg.lstsq58pinv = linpkg.pinv59cholesky = linpkg.cholesky6061_restore_dict = {}6263def register_func(name, func):64if name not in __all__:65raise ValueError("{} not a dual function.".format(name))66f = sys._getframe(0).f_globals67_restore_dict[name] = f[name]68f[name] = func6970def restore_func(name):71if name not in __all__:72raise ValueError("{} not a dual function.".format(name))73try:74val = _restore_dict[name]75except KeyError:76return77else:78sys._getframe(0).f_globals[name] = val7980def restore_all():81for name in _restore_dict.keys():82restore_func(name)838485