https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/numpy/fft/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/numpy/fft/tests/__pycache__/test_helper.cpython-310.pyc
o

6��a�@sddZddlZddlmZddlmZmZGdd�d�ZGdd�d�ZGd	d
�d
�Z	Gdd�d�Z
dS)
zfTest functions for fftpack.helper module

Copied from fftpack.helper by Pearu Peterson, October 2005

�N)�assert_array_almost_equal)�fft�pic@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestFFTShiftcCsdgd�}gd�}tt�|�|�tt�|�|�gd�}gd�}tt�|�|�tt�|�|�dS)N�	r����������������)	rrr
rrrrr	r
�
rrrr	r
���rrr
r)
rrrr
rrrrr	r
�rr�fftshift�	ifftshift)�self�x�y�r�=/usr/lib/python3/dist-packages/numpy/fft/tests/test_helper.py�test_definition
szTestFFTShift.test_definitioncCs2dD]}tj�|f�}tt�t�|��|�qdS)N)rr
�	�d��)�np�randomrrrr)r�nrrrr�test_inverses�zTestFFTShift.test_inversecCs�gd�gd�gd�g}gd�gd�gd�g}ttj|dd�|�ttj|d	d�tj|d
d��ttj|dd�|�ttj|d	d�tj|d
d��tt�|�|�tt�|�|�dS)N)rrr)r	r
r)rr
r)rrr
)rrr)rr	r
�rr��axesr�rr)r�freqs�shiftedrrr�test_axes_keywords��zTestFFTShift.test_axes_keywordcCsvddgddgddgg}ddgddgddgg}ttj|dd�|�ttj|dd�|�ttj|dd�|�ttj|dgd�|�ddgddgddgg}ttj|dd�|�ttj|dd�|�ddgddgddgg}ttj|d	d�|�ttj|d	d�|�ttj|ddgd�|�ttj|ddgd�|�ttj|d
d�|�ttj|d
d�|�tt�|�|�tt�|�|�d
S)z1 Test 2D input, which has uneven dimension sizes rrrr	r
�r"r$r!Nr)rr%�
shift_dim0�
shift_dim1�shift_dim_bothrrr�test_uneven_dims)s<����zTestFFTShift.test_uneven_dimscs�ddlm�m�m�m�d
����fdd�	}d
����fdd�	}td�D]-}td�D]&}d	D]!}tj�||�}t	t
�||�|||��t	t
�||�|||��q.q*q$dS)z\ Test that the new (>=v1.15) implementation (see #10073) is equal to the original (<=v1.14) r)�asarray�concatenate�arange�takeNc	s~�|�}|j}|durtt|��}nt|t�r|f}|}|D]}|j|}|dd}��||��|�f�}�|||�}q|S)z& How fftshift was implemented in v1.14Nrr��ndim�list�range�
isinstance�int�shape�	rr#�tmpr2r�kr�p2�mylist�r/r-r.r0rr�original_fftshiftZs

z>TestFFTShift.test_equal_to_original.<locals>.original_fftshiftc	s��|�}|j}|durtt|��}nt|t�r|f}|}|D] }|j|}||dd}��||��|�f�}�|||�}q|S)z( How ifftshift was implemented in v1.14 Nrrr1r8r=rr�original_ifftshiftjs

z?TestFFTShift.test_equal_to_original.<locals>.original_ifftshift�)rrNr$r!)N)
�
numpy.corer-r.r/r0r4rr�randrrrr)rr>r?�i�j�axes_keyword�inprr=r�test_equal_to_originalVs �����z#TestFFTShift.test_equal_to_originalN)�__name__�
__module__�__qualname__rr r'r,rGrrrrrs

-rc@�eZdZdd�ZdS)�TestFFTFreqcC�pgd�}tdt�d�|�tdtt�dt�|�gd�}tdt�d�|�tdtt�dt�|�dS)Nrrr�
)rr�fftfreqr�rrrrrr��zTestFFTFreq.test_definitionN�rHrIrJrrrrrrL��rLc@rK)�TestRFFTFreqcCrM)N)rrrr	r
r)rrrr	r
r(rN)rr�rfftfreqrrPrrrr�rQzTestRFFTFreq.test_definitionNrRrrrrrT�rSrTc@rK)�
TestIRFFTNcCs2tj�d�\}}|d|}d}tj||d�dS)N)rr@�� y�?)r
r")rrr�irfftn)r�ar�ai�ar#rrr�test_not_last_axis_success�sz%TestIRFFTN.test_not_last_axis_successN)rHrIrJr]rrrrrV�rSrV)�__doc__�numpyr�
numpy.testingrrrrrLrTrVrrrr�<module>s}

https://t.me/RX1948 - 2025