%PDF- %PDF-
Mini Shell

Mini Shell

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

a

z[yc�"�@s�ddlZddlmZddlmZmZmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZddlmZGdd�deej�ZGd	d
�d
�ZGdd�d�ZGd
d�d�ZdS)�N)�assert_warns)�assert_�assert_equal�
assert_raises�assert_array_equal)�masked_array�
masked_values�masked�allequal�MaskType�getmask�MaskedArray�nomask�log�add�hypot�divide��mr_)�picklec@s,eZdZefdd�Zdd�Zedd��ZdS)�MMatrixcCst�|�}tj|||d�}|S)N)�data�mask)�np�matrixr
�__new__)�clsrrZmat�_data�r�N/usr/lib64/python3.9/site-packages/numpy/matrixlib/tests/test_masked_matrix.pyrs
zMMatrix.__new__cCstj�||�t�||�dS�N)rr�__array_finalize__r
)�self�objrrrr!szMMatrix.__array_finalize__cCs|�t�}d|_|S)NF)�viewr
Z_sharedmask)r"Z_viewrrr�_seriess
zMMatrix._seriesN)�__name__�
__module__�__qualname__rrr!�propertyr%rrrrrsrc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�TestMaskedMatrixcCs�t�gd�gd�g�}t|gd�gd�gd�}t|gd�gd�gd�}t|�}t|�t|�tt|d�t|d�u�t|d|dk�t|dtu�t|d|d�t|d	d
d�f|d	d
d�f�t|dd�df|dd�df�t|dd�|dd��t|d
d�|d
d��d|d<d|d<t||�d
|d	d
d�f<d
|d	d
d�f<t||�t|d<t||�t|d	d
d�f<t||�|d	dd�f|d	dd�f<t|d<tt	t
|�t�gd�gd�g���tgd�gd��|d
dd�f<tt	t
|�d
tgd����tt	t
|d
�tgd����tgd�gd��|d
dd�f<tt	t
|d
�tgd����tt	|d
tgd����t�t�d�d�}t
|d�}t||�tt	tgd�td�|j��td|j�dS)N����)�r.r-�r,rr)rr,r�r�r,r)r,r,)rr-rr,r-�	�c)rr,)r,r,r���?�@)rrrr,r�Zdtype)rrr�str�reprr�typer	rr
r�array�arangerrrZ
fill_value)r"Zx1Zx2Zx3Zx4rrr�test_matrix_indexing sP""



$

�z%TestMaskedMatrix.test_matrix_indexingcCsztt�ttd���gd�dd�}tdtjd�D]B}t�tj||d��}t	|j
|j
�t	||�tt|j
tj��q2dS)N�
)r,rr,rrr-r1r,)Zprotocol)rrr�list�rangerZHIGHEST_PROTOCOL�loads�dumpsr�_maskr�
isinstancer)r"�a�protoZ	a_pickledrrr�test_pickling_subbaseclassLs"
z+TestMaskedMatrix.test_pickling_subbaseclasscCs�tt�ddgddgg�t�d�d�}t|jdd�jd	�t|jdd�jd
�t|jdd�ddgg�t|jdd�d
gdgg�dS)Nr,r-r.r/)r-r-r1r)Zaxis)r,r-)r-r,g@r7g�?g@)rrrZzerosr�count�shapeZmean)r"�mrrr�test_count_mean_with_matrixUs
$z,TestMaskedMatrix.test_count_mean_with_matrixcCsbtt�gd�g�gd�d�}t|jdd�t|jdt�tt�|jdd�|ddd�fk��tt�gd�g�gd�d�}tgd�gd�d�|_tt�gd�g�gd�d�}t||�tt�gd�g�gd�d�}|j}|gd	�|dd�<t||�d
|d<tt�t�d��dd�}|j}|dd�}t|j	t�
ddgg��t|jt�
d
d
gg��dS)Nr+)rrr,r1r,r-r)r.r-r,r0)r-r,rr3r6gF)rrrrZflatr	r�allZeyerr<r)r"�testZcontrolZtestflatrF�bZb01rrr�	test_flat_s$(

zTestMaskedMatrix.test_flatcCstt�gd�gd�gd�g�}t�|�}tjgd�gd�gd�gtjd�}t||d�}|d	k}|d	k}t|���t|���t|�d
�t�gd���t|�d�t�gd��j	�t|�d
�t�gd���t|�d�t�gd
��j	�t|���t|���t|�d
�t�gd���t|�d�t�gd��j	�t|�d
�t�gd���t|�d�t�gd��j	�dS)N)g�p=
ף�?g�p=
ף�?g�������?)g�Q����?g��Q��?g)\��(�?)gףp=
��?gףp=
��?gffffff�?)TFF)FFF)TTFr8r1g�?r)FFTr,)TTT)
rr<rZbool_rrrM�anyr�T)r"�x�XrKZmXZmXbigZmXsmallrrr�test_allany_onmatricesxs4
�

��z'TestMaskedMatrix.test_allany_onmatricescCs`tt�gd��gd�d�}|��}t||�tt|tj��t|d<|��}t|gd�g�dS)N)r,r-r.r/)rrrrr1)rr)r-r.r/)rrr�
compressedrrrEr	)r"rFrOrrr�test_compressed�s
z TestMaskedMatrix.test_compressedcCsDtt�gd��gd�gd�}|��}t|jd�t|jj|j�dS)N)r,r-r.r/r5�rr,rrrr1)r,r5)rrrZravelrrJrD)r"rFZaravelrrr�
test_ravel�szTestMaskedMatrix.test_ravelcCs�ttt�d�tj�d���}t�|�}t|dtfdtfgd�}d|j	d<|�
tdftj�}t||�t
t|tj��t
t|t��dS)Nr?rFrOr8r2rr-)r@�ziprr=ZrandomZrandr<r�floatrr$rrrrEr
)r"�iteratorrrFrNrrr�	test_view�s


zTestMaskedMatrix.test_viewN)r&r'r(r>rHrLrPrUrWrYr]rrrrr*s,	
	r*c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestSubclassingcCs,tjddd�}t|gd�d�}||f|_dS)Nr5r[r8rXr1)rr=rr�r"rS�mxrrr�setup_method�szTestSubclassing.setup_methodcCs |j\}}tt|jtj��dSr )rrrErrrr_rrr�test_maskedarray_subclassing�s
z,TestSubclassing.test_maskedarray_subclassingcCs`|j\}}tjdd��6ttt|�t��tt|�t�|��Wd�n1sR0YdS)N�ignore)r)rrZerrstaterrErrrr_rrr�test_masked_unary_operations�s
z,TestSubclassing.test_masked_unary_operationscCs�|j\}}ttt||�t��ttt||�t��tt||�||�ttt||�jtj��t	t
��&ttt�||�t��Wd�n1s�0Yttt||�t��ttt||�t��dSr )
rrrErrrrrrr�DeprecationWarningZouterrr_rrr�test_masked_binary_operations�s

4z-TestSubclassing.test_masked_binary_operationscCs`|j\}}t|j��|jd�}ttt||�t��ttt||�t��tt||�t||��dS)Nr1)	rrZ	__array__rrrErrr)r"rSr`Zxmxrrr�test_masked_binary_operations2�s

z.TestSubclassing.test_masked_binary_operations2N)r&r'r(rarbrdrfrgrrrrr^�s
r^c@seZdZdd�Zdd�ZdS)�TestConcatenatorcCsttjjdd��dS)NcSstdS)Nz
1, 2; 3, 4rrrrr�<lambda>��z6TestConcatenator.test_matrix_builder.<locals>.<lambda>)rr�maZMAError)r"rrr�test_matrix_builder�sz$TestConcatenator.test_matrix_buildercCsPtd}tj�tjd�}t||�tt|�t|��tt|j�t|j��dS)N)�rr,r-r.)	rrrkr<Zr_rrr;r)r"�actualZexpectedrrr�test_matrix�s

zTestConcatenator.test_matrixN)r&r'r(rlrorrrrrh�srh)ZnumpyrZ
numpy.testingrZnumpy.ma.testutilsrrrrZ
numpy.ma.corerrr	r
rrr
rrrrrZnumpy.ma.extrasrZnumpy.compatrrrr*r^rhrrrr�<module>s8*

Zerion Mini Shell 1.0