%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/lib/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/lib/tests/__pycache__/test_regression.cpython-39.pyc

a

z[ycA �@sBddlZddlZddlmZmZmZmZmZm	Z	Gdd�d�Z
dS)�N)�assert_�assert_equal�assert_array_equal�assert_array_almost_equal�
assert_raises�_assert_valid_refcountc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7S)8�TestRegressioncCs.tt�dg�t�ddg�t�ddg��dS)N�r���)r�np�poly1d��self�r�E/usr/lib64/python3.9/site-packages/numpy/lib/tests/test_regression.py�test_poly1ds�zTestRegression.test_poly1dcCs>tj�d�}|��}tj|dd�tj|dd�t||�dS)N)�rT)ZrowvarF)r�random�copyZcovr�r�x�yrrr�test_cov_parameterss
z"TestRegression.test_cov_parameterscCs:td�D],}t�gd�ddg�t�gd�ddg�qdS)N�d)r	�r�r	r)rr	rrr)�rangerZdigitize)r�irrr�test_mem_digitizesz TestRegression.test_mem_digitizecCstgt�t�g���dS�N)rr�unique�arrayr
rrr�test_unique_zero_sizedsz%TestRegression.test_unique_zero_sizedcCsVt�dd��}|t�d�t�d�t�d��|t�d�t�d�t�d�t�d��dS)NcWs|Srr)�argsrrr�<lambda>$�z3TestRegression.test_mem_vectorise.<locals>.<lambda>)r	rr	)rr	r	)r	r	r�rr)r�	vectorize�zeros)rZvtrrr�test_mem_vectorise"s
�z!TestRegression.test_mem_vectorisecCs0ttjddd�dg�ttjdd�g�dS)Nry�?)rrZmgridr
rrr�test_mgrid_single_element)sz(TestRegression.test_mgrid_single_elementcCsdd�}t�|�}t|�dS)NcSsdS)N�{r)rrrrr�p0sz1TestRegression.test_refcount_vectorize.<locals>.p)rr'r)rr,�vrrr�test_refcount_vectorize.s
z&TestRegression.test_refcount_vectorizecCs.tjtjtjdgdd�}ttjjt|d�dS)Nr	F)�rr/)rr�nanrZlinalgZLinAlgError�getattr)rr,rrr�test_poly1d_nan_roots5sz$TestRegression.test_poly1d_nan_rootscCst�gdg�dS)Ng�?)rZpolymulr
rrr�test_mem_polymul:szTestRegression.test_mem_polymulcCst�g�}t�|d�dS)Nz
asdasd	asdasd)rr!�append)rrrrr�test_mem_string_concat>s
z%TestRegression.test_mem_string_concatcCsBt�gd��}t�gd��}t�||�\}}t||||�dS)N�r	rr)r	rrr�)rr�polydivr)r�ur-�qr/rrr�
test_poly_divCszTestRegression.test_poly_divcCs8t�gd��}t�ddg�}t||k�t||k�dS)Nr6rr)rrrrrrr�test_poly_eqJszTestRegression.test_poly_eqcCs4gd�}gd�}gd�}t�||d�}t||�dS)N)g1$���ͱ�g�HP�B?g�{p#��g�p�I�#@g
K<�l�s�)Q�Z�[�\�]�^�_�`�a�b�cr�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�zr+�|�}�~��������������������������������������������)Q�"@�@�@�@r�� @�@�&@r�r�r��@r�r�r�r�r��$@r�r�r�r�r�r�g*@r�r�r�r�r�r�r�r�r�r��(@r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)rZpolyfitr)r�refrrZtestedrrr�test_polyfit_buildQs
z!TestRegression.test_polyfit_buildcCshd}tjdtd�}t�||�\}}t|jtk|�d}tjdtd�}t�||�\}}t|jtk|�dS�NzWrong type, should be complexr��dtypezWrong type, should be float)r�ones�complexr8rr��int�float)r�msgrr:r/rrr�test_polydiv_typefsz TestRegression.test_polydiv_typecCstttjt�d�dd�dS)N)r	�
i)Zbins)r�
ValueErrorrZhistogramddr�r
rrr�test_histogramdd_too_many_binsqsz-TestRegression.test_histogramdd_too_many_binscCsTd}tjdtd�}tt�|�jtk|�d}tjdtd�}tt�|�jtk|�dSr�)rr�r�rZpolyintr�r�r�)rr�rrrr�test_polyint_typeusz TestRegression.test_polyint_typecCstt�t�gg���dSr)�listrZndenumerater!r
rrr�test_ndenumerate_crash~sz%TestRegression.test_ndenumerate_crashcCs tt�tjg�t�dg��dSr)rrr!r0Zasfarrayr
rrr�test_asfarray_none�sz!TestRegression.test_asfarray_nonecsVt�tj�jd}td|dd���fdd�}�fdd�}tt|�tt|�dS)	N�rg�������?r	c	s@d}t�|fd�}tjjd|�d�}d|t�|||||�<dS�Nrr7r)�size�rr�rZrandintZix_��n�ar�Zthesizerr�dp�sz4TestRegression.test_large_fancy_indexing.<locals>.dpcs@d}t�|fd�}tjjd|�d�}|t�|||||�dSr�r�r�r�rr�dp2�sz5TestRegression.test_large_fancy_indexing.<locals>.dp2)rr�Zintp�itemsizer�rr�)r�nbitsr�r�rr�r�test_large_fancy_indexing�s
z(TestRegression.test_large_fancy_indexingcCs6t�ddg�}t�d|�}ttj||fj|k�dS)N)r�Zf4)�bZi4)r	)rr�r(rZr_)r�dtrrrr�test_void_coercion�sz!TestRegression.test_void_coercioncCs�ddl}ddl}|j}t|jd�|_zHzt�dt�d�i�WntyXt	d��Yn0W|j�
�||_n|j�
�||_0dS)Nr�wZfoor	zticket #1243)�os�sys�stdout�open�devnullrZwhor!�	Exception�AssertionError�close)rr�r�Z	oldstdoutrrr�test_who_with_0dim_array�s
�
z'TestRegression.test_who_with_0dim_arraycCs2t��g}|D]}tt|t��t|dk�qdS)N�)rZget_includer�
isinstance�str)rZinclude_dirs�pathrrr�test_include_dirs�s
z TestRegression.test_include_dirscCsxttt�t�dg�d�tj��ttt�dgd�tj��ttt�t�dg�d�tj��ttt�dgd�tj��dS)Nr	r)rr�rZpolyderrZndarrayr
rrr�test_polyder_return_type�s  z'TestRegression.test_polyder_return_typecCszddlm}tjgd�tjd�}gd�}t�d��tj�}tjtjtjg}z|||||�Wntytt	��Yn0dS)Nr)�
append_fieldsr6r�)r�r��cr)
Znumpy.lib.recfunctionsr�rr!Zint32ZeyeZastypeZfloat64r�r�)rr��base�names�dataZdlistrrr�test_append_fields_dtype_list�sz,TestRegression.test_append_fields_dtype_listcCs�ddlm}ddg}tj|d�|d�}t|tjdg|d��dd	d
gfg}tj|d�|d�}t|tjdg|d��dg}tj|d�|d�}t|tjd
g|d��dg}tj|d�|d�}dg}t|tj||d��dS)Nr)�StringIO)r��u1r)r�r�rz0 1 2 3r���rr	�rrr�)r�r�)r	r)r�r�)))rr	rr)r�r�r&)r�)r�r�)rrrz0 1 2 3 4 5 6 7 8 9 10 11)))r�r�)rr7))��)r��	)r��)�ior�rZloadtxtrr!)rr�r�rr�rrr�test_loadtxt_fields_subarrays�sz,TestRegression.test_loadtxt_fields_subarrayscCs:tjdtd�}zt�|�Wnty4t��Yn0dS)Nrr�)rr(�boolZnansumr�r�)rr�rrr�test_nansum_with_boolean�s
z'TestRegression.test_nansum_with_booleancCsdGdd�d�}ttjd�}z:ztj|�|d�WntyHt��Yn0W|��n
|��0dS)Nc@seZdZdZdS)z)TestRegression.test_py3_compat.<locals>.Cz3Old-style class in python2, normal class in python3N)�__name__�
__module__�__qualname__�__doc__rrrr�C�sr�r�)�output)r�r�r�r�info�AttributeErrorr�r�)rr��outrrr�test_py3_compat�szTestRegression.test_py3_compatN)r�r�r�rrrr"r)r*r.r2r3r5r;r<r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr
s6		
r)r�ZnumpyrZ
numpy.testingrrrrrrrrrrr�<module>s 

Zerion Mini Shell 1.0