403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.170
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/matplotlib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/matplotlib/tests/__pycache__/test_triangulation.cpython-312.pyc
�

G8�c.�����ddlZddlmZmZmZddlmcmZ	ddl
Z
ddlZddl
mZddlmZddlmZddlmZmZGd�d�Zd�Zd�Zd	�Zd
�Zd�Ze
j<j?dggfd
gdgfd
dgddgfgd�gd�fgd�gd�fgd�gd�fg�d��Z d�Z!edg�d��Z"d�Z#d�Z$d�Z%d�Z&d�Z'd �Z(d!�Z)d"�Z*d#�Z+d$�Z,d%�Z-ed&gd'd(�)�d*��Z.ed+gd'd,�)�d-��Z/d.�Z0d/�Z1e
j<j?d0ejdejfgd1d2g�3�d4��Z4d5�Z5d6�Z6d7�Z7d8�Z8d9�Z9d:�Z:d;�Z;d<�Z<d=�Z=d>�Z>e�d?��Z?d@�Z@y)A�N)�assert_array_equal�assert_array_almost_equal�assert_array_less)�Path)�image_comparison�check_figures_equalc�.�eZdZgd�Zgd�Zgd�gd�gZddgZejjdeegieeddgfeeegieeedgfeege
e�	�eeedgfeege
e�
�eedegfeeege
e�
�eeeegfeege
ee��eeeegfg�d��Zy)
�TestTriangulationParams����r�r�rrrr
�rr
��rr�FTzargs, kwargs, expectedN��	triangles��mask�rrc���ddg}ddd�}tjj||zi|�|��\}}}}	}
}|\}}
}}||usJ�||
usJ�t||�|	|usJ�|
|k(sJ�||k(sJ�y)Nr
rr�4)�a�b)�mtri�
Triangulation�_extract_triangulation_paramsr)�self�args�kwargs�expected�
other_args�other_kwargs�x_�y_�
triangles_�mask_�args_�kwargs_�x�yrrs                �E/usr/lib/python3/dist-packages/matplotlib/tests/test_triangulation.py�!test_extract_triangulation_paramsz9TestTriangulationParams.test_extract_triangulation_paramss�����V�
��S�)�����<�<��z�!�#=�f�#=��#=�
?�	2��B�
�E�5�'�!)���1�i���Q�w��w��Q�w��w��:�y�1���}��}��
�"�"�"��,�&�&�&�)�__name__�
__module__�__qualname__r+r,rr�pytest�mark�parametrize�dictr.�r/r-r
r
s����A��A��I�&�I��4�=�D��[�[���5�
�Q���a��D�$�'�(�
�Q�	�	�B��A�y�$� 7�8�
�Q���	�*�Q��9�d�,C�D�
�Q���4��1�a��t�"4�5�
�Q�	�	�D�d�O�a��I�t�-D�E�
�Q���	��5��1�i��7N�O�
8��'��'r/r
c��dg}gd�gd�gd�g|g}tjj|i�\}}}}}}|�J�||gk(sJ�y)NT�rrr
�rrr
r)rrr)rr r%r&r'r(r)r*s        r-�*test_extract_triangulation_positional_maskr;+sX���6�D��y�9�+�t�4�D����8�8��r�B�.�B��J��u�g��=��=��T�F�?��?r/c���gd�}gd�}tjtd��5tj|ddg�ddd�tjtd��5tj||gd��ddd�tjtd	��5tj||d
�ddd�tjtd��5tj||gd�g�ddd�tjtd
��5tj||gd�g�ddd�y#1swY��xYw#1swY��xYw#1swY��xYw#1swY�lxYw#1swYyxYw)Nrrzx and y must be equal-length��matchr
rz>triangles must be a \(N, 3\) int array, but found shape \(3,\)rz3triangles must be a \(N, 3\) int array, not 'other'�otherzfound value 99)rr
�czfound value -1)rr
r�r3�raises�
ValueErrorrr�r+r,s  r-�test_triangulation_initrE7s6���A��A�	���z�)G�	H�&����1�q�!�f�%�&�	�����
�,�	
���1�a��+�	,�

����H�
J�*�	
���1�a��)�*�
���z�)9�	:�/����1�a�*��.�/�	���z�)9�	:�/����1�a�*��.�/�/�&�&��,�,��
*�*��/�/��/�/�s;�D:� E�E�E�E*�:E�E�E�E'�*E3c��d}d}tjtjdd|�tjdd|��\}}|j�}|j�}||z}d|dz
z|dz
z}d|z|zd|zz
d|zz
dz}t	j
||�}t
|j|�t
|j|�t|j�|k(sJ�tj|j�dk(sJ�tj|j�|dz
k(sJ�t|j�|k(sJ�tj|j�dk(sJ�tj|j�|dz
k(sJ�|j}d|_t!|j|�t!tj"|j�tj$|��y)	N�����?rr
rr)�np�meshgrid�linspace�ravelrrrr+r,�lenr�min�max�edges�	neighbors�
_neighborsr�unique�arange)	�nx�nyr+r,�npoints�
ntriangles�nedges�triangrSs	         r-�
test_delaunayr]Ks���	
�B�	
�B�
�;�;�r�{�{�3��R�0�"�+�+�c�3��2K�L�D�A�q�	���	�A�	���	�A���e�G��b��d��r�!�t�$�J�
�r�T�"�W�q��t�^�a��d�
"�Q�
&�F��
�
��1�
%�F��f�h�h��*��f�h�h��*��v��� �J�.�.�.�
�6�6�&�"�"�#�q�(�(�(�
�6�6�&�"�"�#�w�q�y�0�0�0��v�|�|���&�&�&�
�6�6�&�,�,��1�$�$�$�
�6�6�&�,�,��7�1�9�,�,�,�
� � �I��F���v�'�'��3��r�y�y��!1�!1�2�B�I�I�g�4F�Gr/c��d}d}d}tjjd�tjj|�}tjj|�}||||<||||<tj||�}ttj|j�tjtj|�|��y)N�
�r�)
rK�random�seedrrrrUr�deleterV)rY�	duplicate�duplicate_ofr+r,r\s      r-�test_delaunay_duplicate_pointsrgus����G��I��L��I�I�N�N�2��
�	�	����!�A�
�	�	����!�A��\�?�A�i�L��\�?�A�i�L��
�
��1�
%�F��r�y�y��!1�!1�2��y�y����7�!3�Y�?�Ar/c�l�tjddd�}tjddd�}tjt�5tj||�ddd�tj|d�}tj|d�}tj||�y#1swY�LxYw)NrI�$@��@g @)rKrMr3rB�RuntimeErrorrr�appendrDs  r-�test_delaunay_points_in_linern�s���	���C��r�"�A�
���C��r�"�A�	���|�	$�!����1�a� �!�	�	�	�!�S��A�
�	�	�!�S��A����q�!��
!�!�s�B*�*B3zx, yr
rGr�)r
rr
)rGrorG)r
rr)rGroro)r
r
r
rr
r)rGrGrGrorGroc��tjt�5tj||�ddd�y#1swYyxYw�NrArDs  r-�!test_delaunay_insufficient_pointsrr�s5��
���z�	"�!����1�a� �!�!�!�s	�:�Ac
�x��tjddgddgddgddgddgd	d
gddgg�}tjd
dgddgddgddgddgddgddgg�}d���fd�}tj|dd�df|dd�df�}|D]}|||�dk(r�J�tj|dd�df|dd�df�}y)Ng�LX�z��?g�gCM��?�?g~9B.���?g�g�/7�R�?g���9��?gڿgH���C��?gڿg���t
�?gڿg��(\��?gq=
ףpݿg�������?g�z�G�ڿ�ffffff�?g���Q�޿g)\��(ܿ��?皙�����?c�x�tj||f�j}t|�j	|�Srq)rK�vstack�Tr�contains_point)�xtri�ytri�xy�
tri_pointss    r-�tri_contains_pointz0test_delaunay_robust.<locals>.tri_contains_point�s0���Y�Y��d�|�,�.�.�
��J��.�.�r�2�2r/c�H����t���fd��jD��S)Nc3�f�K�|](}��j|�j|�����*y�wrqrD)�.0�trirr\r}s  ���r-�	<genexpr>zCtest_delaunay_robust.<locals>.tris_contain_point.<locals>.<genexpr>�s2�����0��&�f�h�h�s�m�V�X�X�c�]�B�G�0�s�.1)�sumr)r\r}rs``�r-�tris_contain_pointz0test_delaunay_robust.<locals>.tris_contain_point�s#����0�$�.�.�0�0�	0r/rr
)rK�array�asarrayrr)r~�test_pointsr�r\�
test_pointrs     @r-�test_delaunay_robustr��s������	�0�1�	�0�1�	�0�1�	�0�1�	�0�1�	�0�1�	�1�2�4�5�J��*�*�	
�u�
�	
�u�
�	
�u�
�	�e��	�e��	
�u�
�	�e����K�3�0��
�
�
�1�a�4� 0�*�Q��T�2B�
C�F�!�;�
�!�&�*�5��:�:�:�;�
�
�
�
�1�2�q�5� 1�:�a�b�!�e�3D�
E�Fr/ztripcolor1.pngc
��tjgd��}tjgd��}tjgd�gd�gd�gd�gd�gd�gd	�gd
�gd�gd�g
�}tj|||�}|d
|zz}||jjd��}||jjd��}d
|z|z}t
jd�t
j||d��t
jd�t
jd�t
j||d��t
jd�y)N)
r��?r
rr�r
rr�r
ru)
rrrr�r�r�r
r
r
ru�rr
r)r
rHr�r
rrH)rrGrH)rrHro)rHr`ro)rHrG�	)r`rHr�)�r`r�)rGr�r�r�r
��axis�y�k)�
edgecolorszpoint colors�z)�
facecolorsr�r�)
rKr�rrr�mean�plt�subplot�	tripcolor�title)r+r,rr\�Cpoints�xmid�ymid�Cfacess        r-�test_tripcolorr��s��
�
�
�>�?�A�
�
�
�>�?�A��
�
��9��9��9��9�i��	4�5�I��
�
��1�i�
0�F��#�a�%�i�G��V�
�
��#�#��#�+�D��V�
�
��#�#��#�+�D�
��X��_�F��K�K����M�M�&�'�c�2��I�I�n���K�K����M�M�&�V��<��I�I�l�r/c�8�gd�}gd�}tj�\}}tjtd��5|j||�ddd�tjtd��5|j||gd��ddd�tjtd��5|j||gd��	�ddd�tjtd
��5|j||ddgd
��ddd�tjtd
��5|j||ddgd
��ddd�tjtd��5|j||gd���ddd�|j||gd��|j||gd�d
��|j||ddg�|j||ddg�	�y#1swY���xYw#1swY��YxYw#1swY��,xYw#1swY��xYw#1swY��xYw#1swY��xYw)Nrrz!tripcolor\(\) missing 1 required r=z!The length of c must match either�r
rrz,length of facecolors must match .* triangles)r
rrrH�r�z-'gouraud' .* at the points.* not at the facesr
r�gouraud)r��shading)r�z+positional.*'c'.*keyword-only.*'facecolors')�C)r��subplotsr3rB�	TypeErrorr�rC)r+r,�fig�axs    r-�test_tripcolor_colorr��s����A��A��l�l�n�G�C��	���y�(L�	M��
���Q����	���z�)L�	M�&�
���Q��9�%�&�	���z�K�
M�4�
���Q��l��3�4�
���z�L�
N�A�
���Q��q�!�f�i��@�A�
���z�L�
N�6�
���Q��A�q�6�9��5�6�
���y�J�
L�+�
���Q��\��*�+�
�L�L��A�|�$��L�L��A�|�Y�L�7��L�L��A��1�v���L�L��A�1�a�&�L�)�+���&�&��4�4��A�A��6�6��+�+�sG�G�1G�*G+�$G8�H�H�G�G(�+G5�8H�H
�Hc��tjjd�tjjd�tjjd�tjjd�}}}t	j
�j
�}d}|j||||��j}|j|jf|k(sJ�y)Ni!N,r_)��?ru)�clim)rKrbrc�randr��figure�add_subplotr��norm�vmin�vmax)rr�cr�r�r�s      r-�test_tripcolor_climr�s����I�I�N�N�8���i�i�n�n�R� �"�)�)�.�.��"4�b�i�i�n�n�R�6H�!�q�A�	����	!�	!�	#�B��D�
�<�<��1�a�d�<�+�0�0�D��I�I�t�y�y�!�T�)�)�)r/c���gd�}gd�}ddg}tj�\}}tjtd��5|j|||d�ddd�tjtd��5|j||||�	�ddd�tjtd��5|j||d
|�	�ddd�y#1swY�|xYw#1swY�OxYw#1swYyxYw)Nrr皙�����?r�zAdditional positional paramr=�unused_positionalz"Positional parameter c .*no effectr�zinterpreted as c)r�r�r3�warns�DeprecationWarningr��UserWarning)r+r,r�r�r�s     r-�test_tripcolor_warningsr�s����A��A�	�c�
�A��l�l�n�G�C��	���(�0M�	N�3�
���Q��1�1�2�3�
���k�)M�	N�,�
���Q��1���+�,�	���k�)M�	N�=�
���Q��-�!��<�=�=�3�3��,�,��=�=�s#�C�7C�0C'�C�C$�'C0c��tjgd�gd�gtj��}tjgd��}|j�}t	j
|dd�df|dd�df|�jt||�y)N�rrr)rr
r��dtype))rr)rg�������?)r
r)r
r
rr
)rKr��int32�copyrrrRr)r�points�
old_triangless   r-�test_no_modifyr�%sh�����)�Y�/�r�x�x�@�I�
�X�X�8�
9�F��N�N�$�M����v�a��d�|�V�A�q�D�\�9�=�C�C��}�i�0r/c��tjtjd�tjd��\}}|j�}|j�}gd�gd�gd�gd�gd�gd�gd�gd	�gd
�gd�gd�gd
�gd�gd�gd�gd�gd�gd�g}tjt|��}d|ddt
j||||�}|j�}gd�}gd�}tj||�\}}|j�}|j�}|||�}t|gd��||dz
|dz
�}t|gd��gd�}gd�}|||�}t|gd��ddg}ddg}|||�}t|d d!g�d}	gd"�}d#d d d d |	dg}gd$�gd%�gd&�gd�gd'�gd(�gd)�gd*�g}t
j|||�}|j�}gd+�}d,d-g}tj||�\}}|||�}t|gd.�gd/�g�d}	d#|	d d d d dg}gd0�}gd1�gd2�gd3�gd4�gd5�gd6�gd7�gd*�g}t
j|||�}|j�}d,d-g}gd+�}tj||�\}}|||�}t|d#d#gd d8gd d8gd d9gdd9gdd:gd#d#gg�gd;�}gd<�}gd1�gd=�g}t
j|||�}|j�}gd>�}gd?�}|||�}t|gd@��|jdd g�||j�k(sJ�|||�}t|gdA��y)BNrH�rr
rH�r
rGrH�r
rrG�rrorG�rrro�rr`ro�rHrGr��rGr�r��rGror��ror_r��ror`r_�r`rjr_�r�r���r��
r��r�r_r��r_�r��r_rjr��rj�r�r
r�r_)r���?�@�
@)rrrHrrorr_rr�r��rrrrrr�)rrrrrr
rrGrr`rrjrr�r��)r���?�@r�r�r�r�r�rIrJrk�@)rIrIrIr�r�r�rJrkr�r�r�r�)rrrHr�r�r�rr�ror`r_rjrIr�rr��r�rr
rrr�r�rr9�rrr�rrHr�rrrG�rrHrG�r
rGro�rHrorG)皙������r���������?gffffff�?gffffff�?g333333@g333333@r�皙�����?)rrrr
r
rr)rrororor`r`r)r�r�rr
rrr�r)rr
rGr�)r
rrH)r
rHrG)rror)rrorHrGror`�rr
rr
�rrr
r
�r
rr)g������ɿ皙�����?rvg333333�?)r�r�r�r�)rrr
r)rrr
r)rKrLrVrN�zerosrOrr�
get_trifinderr�set_mask)
r+r,rrr\�	trifinder�xs�ys�tris�deltas
          r-�test_trifinderr�/sj��
�;�;�r�y�y��|�R�Y�Y�q�\�2�D�A�q�	���	�A�	���	�A��I�y�)�Y��I�y�)�Z��[�*�k�;��|�\�;�I��8�8�C�	�N�#�D��D��2�J�
�
�
��1�i��
6�F��$�$�&�I�	!�B�	!�B�
�[�[��R�
 �F�B��	����B�	����B��R���D��t�>�?��R��V�R��V�$�D��t�=�>�
F�B�	E�B��R���D��t�G�H��s��B�

�s��B��R���D��t�a��W�%�
�E�'�A�	�a�!�a��E�1�%�A��I�y�)�Y��I�y�2�I�
�
�
��1�i�
0�F��$�$�&�I�	-�B�
���B�
�[�[��R�
 �F�B���R���D��t�5�5�7�8�
�E�	�e�V�Q��Q��1�%�A�'�A��I�y�)�Y��I�y�2�I�
�
�
��1�i�
0�F��$�$�&�I�
���B�	-�B�
�[�[��R�
 �F�B���R���D��t�r�2�h��A���A���A���A���A��!�2�h�(�)�
	�A��A��I�&�I�
�
�
��1�i�
0�F��$�$�&�I�	�B�	�B��R���D��t�^�,�
�O�O�Q��F����,�,�.�.�.�.��R���D��t�_�-r/c�F����tjtjd�tjd��\}}|j�}|j�}d|zd|zz
}gd�gd�gd�gd�gd�gd	�gd
�gd�gd�gd
�gd�gd�gd�gd�gd�gd�gd�gd�g}tjt|��}d|ddt
j||||�}t
j||�}t
j||�}t
j||d��}tjddd�}	gd�}
tj|	|
�\}	}
|||fD] }||	|
�}t|d|	zd|
zz
��"gd�}	|	}
tj|	|
�\}	}
|||fD])}||	|
�}t|jd gdzgdz��+tjdd!d�}	gd"�}
tj|	|
�\}	}
|||fD]W}||	|
�}tj|d|	zd|
zz
�|	dk\|	d#kz|
dk\z|
d#kz}t|j|��Yd$\������fd%�}
���fd&�}tjgd'��}tjgd(��}tjgd)�gd*�gd+�gd,�gd-�gd.�gd/�gd0�g�}t
j|||�}|
||�}|||�}tjd1d2d3�}	tjd1d2d3�}
tj|	|
�\}	}
t
j||d4|�5�}||	|
�}t||
|	|
��|j!||�\}}|||�\}}t||�t||�d6}tjtjd1d2|dz�tjd1d2|dz��\}}|j�}|j�}|
||�}t
j||t#|dz��7�}tjtjd8d9d3�tjd8d9d3��\}	}
|	j�}	|
j�}
t
j||�}t
j||�}t
j||d��}|
|	|
�}tj$||	|
�|z
�}||fD]�}tj$||	|
�|z
�}tj&|�dtj&|�zk\sJ�tj(||�d:tj(||�zk\r��J�y);NrH�G�z��?�)\��(@r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r�r_�geom��kindr��@ro)r�rur�r)gпr���?r�Tr)r�rur�rr)rg)\��(��333333�?c�D���|dz
dzz�|dz
dzzz�|z|zzS)Nr�rr7�r+r,rrr�s  ���r-�quadztest_triinterp.<locals>.quad�s3����!�C�%�!��|�a��3���
�l�*�Q�q�S��U�2�2r/c�H��d�z|dz
z�|zzd�z|dz
z�|zzfS)Nrr�r7r	s  ���r-�
gradient_quadz%test_triinterp.<locals>.gradient_quad�s8����!��Q�s�U��a��c�!�1�Q�3��#��;��1��#4�5�5r/)r��&jj�Z�?�� �rh�?rIrJrJrI)�333333�?�HP�s��?�X9��v��?rIrIrJrJr�rrrH�rHrr�rHrrG�r
rGr�rorGr
�ror
r�rorrrIrJrG�user�r�dzrjrr�r��d)rKrLrVrNr�rOrr�LinearTriInterpolator�CubicTriInterpolatorrMrrr�matestr��gradient�meshgrid_triangles�absrQ�dot)r+r,�zrrr\�
linear_interp�cubic_min_E�
cubic_geomr�r��interp�zsr
rr�
cubic_user�	interp_zs�interp_dzsdx�interp_dzsdy�dzsdx�dzsdy�n�diff_lin�
diff_cubicrrr�s                         @@@r-�test_triinterpr3�s���
�;�;�r�y�y��|�R�Y�Y�q�\�2�D�A�q�	���	�A�	���	�A��Q���a���A��I�y�)�Y��I�y�)�Z��[�*�k�;��|�\�;�I��8�8�C�	�N�#�D��D��2�J�
�
�
��1�i��
6�F��.�.�v�q�9�M��+�+�F�A�6�K��*�*�6�1�6�B�J�	���T�4��	#�B�	!�B�
�[�[��R�
 �F�B�� �+�z�:�;��
�B��^��!�"�t�B�w��b��'8�:�;�

#�B�	�B�
�[�[��R�
 �F�B�� �+�z�:�2��
�2�r�
"���2�7�7�d�V�A�X�J�q�L�1�2�

���T�4��	#�B�	!�B�
�[�[��R�
 �F�B�� �+�z�:�*��
�B��^���(�(��d�2�g��R��.?�A��a��B�!�G�$��a��0�B�!�G�<���2�7�7�D�)�	*�#�I�Q��1�3�6�	���6�7�A�
���7�8�A����)�Y�	�9�#�Y�	�9�F�G�I�
�
�
��1�i�
0�F��Q��
�A�	�q�!�	�B�	���R��Q�	�B�	���R��Q�	�B�
�[�[��R�
 �F�B���*�*�6�1�6�b�I�J��2�r�"�I��i��b�"��6�#-�#6�#6�q�!�#<� �\�<�"�1�a�(�N�U�E��l�E�2��l�E�2�	�A�
�;�;�r�{�{�2�r�1�Q�3�/����R��Q�q�S�1I�J�D�A�q�	���	�A�	���	�A��Q��
�A�
�
�
��1�0B�1�Q�3�0G�
H�F�
�[�[����S�#�q�1�2�;�;�s�C��3K�
L�F�B��	����B�	����B��.�.�v�q�9�M��+�+�F�A�6�K��*�*�6�1�6�B�J�	
�b�"��B��v�v�m�B��+�b�0�1�H��
�+�6���V�V�F�2�r�N�R�/�0�
��v�v�h��2����z�(:�#:�:�:�:����x��*��b�f�f�Z��4�4�5�	6�5�6r/c��dd�}d\}}d\}}d\}}tj|||ddddg�}tj|||ddddg�}tjgd�gd�gd	�gd
�gd�gd�gd
�gd�g�}	tj|||	�}
t	d�D�]�}tj
dtj��}tj
dtj��}
tj
dtj��}tj
ddgtj��}|dz}d|||dzf<|dk(rd||<n|dk(r	d|
|dz<n
|dk(rd||dz<tj|
|d|
|f��}||||f|dd�df�||||f|dd�df�||||f|dd�df�||||zdz||zdzf�||||zdz||zdzf�||||zdz||zdzf�||||z|zdz||z|zdzf�||d|z|z|zdzd|z|z|zdzf�|||d|zz|zdz|d|zz|zdzf�||||zd|zzdz||zd|zzdzf����y)Nc	��d}d}d}|\}}||tjtjddtjz|��zz}||tjtjddtjz|��zz}	||g|g�d}
|j|g|g�\}}|�3t
|
|d�t
|d|d�t
|d|d�|||	�|
z
}
|j||	�\}}||z
}||z
}t|
||z�t|||z�t|||z�y)	aJ
        Checks the continuity of interpolator (and its derivatives) near
        location loc. Can check the value at loc itself if *values* is
        provided.

        *interpolator* TriInterpolator
        *loc* location to test (x0, y0)
        *values* (optional) array [z0, dzx0, dzy0] to check the value at *loc*
        �绽���|�=gY@rIrrNr
)rK�cosrM�pi�sinr rr)�interpolator�loc�values�n_star�epsilonr��loc_x�loc_y�star_x�star_yr$�dzx�dzy�diff_z�tab_dzx�tab_dzy�diff_dzx�diff_dzys                  r-�check_continuityz;test_triinterpcubic_C1_continuity.<locals>.check_continuitysA��������������������B��"�%�%���(H�!I�I�I����������B��"�%�%���(H�!I�I�I���%��5�'�*�1�-��!�*�*�E�7�U�G�<�
��c���%�a����3�%�c�!�f�f�Q�i�8�%�c�!�f�f�Q�i�8��f�f�-��1��)�2�2�6�6�B���'��S�=���S�=���&�'�!�)�,��(�G�A�I�.��(�G�A�I�.r/)r�r)r
r)rrrIrJrrrrrrrrr�r`r�rrr
rrrr�r��@g@rq)rKr�rr�ranger��float64r)rKr��ay�bx�by�cx�cyr+r,rr\�idofr$rDrEr=�caser(s                  r-�!test_triinterpcubic_C1_continuityrV�s���/�>�H�R��!�H�R���H�R��
���"�b�"�b�"�b�"�-�.�A�
���"�b�"�b�"�b�"�-�.�A����)�Y�	�9�#�Y�	�9�F�G�I�
�
�
��1�i�
0�F��a��G���H�H�Q�b�j�j�)���h�h�q��
�
�+���h�h�q��
�
�+�����1�a�&��
�
�3���Q�w��!$��t�T�A�X�~���1�9��A�d�G�
�Q�Y��C��q��M�
�Q�Y��C��q��M��*�*�6�1�6�/2�C�j�:��	��"�b��6�!�Q�$�<�8���"�b��6�!�Q�$�<�8���"�b��6�!�Q�$�<�8���2�b�5�#�+��2��s�{�!;�<���2�b�5�#�+��2��s�{�!;�<���2�b�5�#�+��2��s�{�!;�<���2�b�5��8�R�-�"�R�%��(�B��!?�@���2�b�5��8�B�;��"2�R��U�2�X�b�[�"�4D�!E�F���2�b��e�8�B�;��"2�R��2��X�b�[�"�4D�!E�F���2�b�5��B��;��"2�R��U�2�b�5�[�"�4D�!E�F�9Gr/c	���d�}d\}}tjj|||��}|j�|j	�}t||z�D]�}t
j||ztj��}d||<tjj||t
j||z�d��\}}tt
j||�|���d\}	}
|||�\}}}
}|d||	k\zzd||
k\zz}|
d|
|	k\zzd|
|
k\zz}
t
j||	|	dz
|
|
dz
gg�}t
j|
|	dz
|	|
dz
|
gg�}
t
j|gd	�g�}tjj|||
||zd
z||zd
zf�}|j�|j	�}t||zd
z�D]�}t
j||zd
ztj��}d||<tjj||t
j||zd
z�d��\}}tt
j||�|���t
jdtj��}t
jgd�tj��}t
jgd
�tj��}
d}tjj|||
|�}|j�|j	�}t|t
jgd�gd�gd�gtj���y)Nc��||z}tjtj|tj��tj|dz
tj��tjd|tj��tj||z
tj��tj||tj��g�}tjtj|tj��tjd|tj��tj|dz
tj��tj||tj��tj||z
tj��g�}tjdtj|tj
��ztj|dz
tj
��tj|dz
tj
��tj||z
tj
��tj||z
tj
��g�}d||d|zdz
|dz
d|�<d|d|zdz
d|zdz
|dz
d|�<|||||z||zffS)z�
        Return the sparse, (n*m, n*m) matrix in coo format resulting from the
        discretisation of the 2-dimensional Poisson equation according to a
        finite difference numerical scheme on a uniform (n, m) grid.
        r�r
rHrIrNr)rK�concatenaterVr��onesrN)r0�m�l�rows�cols�valss      r-�poisson_sparse_matrixz<test_triinterpcubic_cg_solver.<locals>.poisson_sparse_matrixOs���
�a�C���~�~��I�I�a�r�x�x�(��I�I�a��c����*�B�I�I�a��"�(�(�,K��I�I�a��c����*�B�I�I�a��"�(�(�,K�M�N���~�~��I�I�a�r�x�x�(��I�I�a��"�(�(�+�R�Y�Y�q��s�"�(�(�-K��I�I�a��"�(�(�+�R�Y�Y�q��s�"�(�(�-K�M�N���~�~�
�b�g�g�a�r�z�z�*�*�
�W�W�Q�q�S��
�
�
+�+�b�g�g�a��c����.L�-L�
�W�W�Q�q�S��
�
�
+�+�b�g�g�a��c����.L�-L�N�O��
!#��Q�q��s�1�u�
�a��c�f�1�f��$&��Q�q�S��U�1�Q�3�q�5��!�A�#�&�q�&�!��T�4�!�A�#�q��s��+�+r/)r�rHr�rJr7)�Ar�x0�tol)r��1r
)rJrJrJrJrr�)rr
rrrr
r
rrrrrr
r
r
r
r
)rr
rr
r
rrr
r
r
r
r
rrrrr)rr)rJrkrI)rkrJ�@)rIrerJ)r�triinterpolate�_Sparse_Matrix_coo�compress_csc�to_denserMrKr�rN�_cgrr#rYrZr�r�)r`r0r[�mat�	mat_dense�itestrr+�_�i_zero�j_zeror_r]r^�dims               r-�test_triinterpcubic_cg_solverrrKs	��,�2�F�Q��
�
�
�
0�
0�2G��1�2M�
N�C���������I��q��s��;���H�H�Q�q�S��
�
�+����%���"�"�&�&���b�h�h�q��s�m�+1�'�3���1�!�"�&�&��A�"6��:�;� ��V�V�/��1�5��D�$��a��!�T�V�^�$�$�q�$�&�.�'9�9�D��!�T�V�^�$�$�q�$�&�.�'9�9�D�
�>�>�4�&�&��(�F�F�1�H�!E�F�G�D�
�>�>�4�&��(�F�F�1�H�f�!E�F�G�D�
�>�>�4�!1�2�3�D�
�
�
�
0�
0��t�T�23�A�#��'�1�Q�3��7�1C�E�C���������I��q��s�Q�w��;���H�H�Q�q�S�1�W�B�J�J�/����%���"�"�&�&���b�g�g�a��c�A�g�6F�+1�'�3���1�!�"�&�&��A�"6��:�;��7�7�2�R�Z�Z�(�D�
�8�8�G��(�(�$�D�
�8�8�G��(�(�$�D�
�C�
�
�
�
0�
0��t�T�3�
G�C���������I��i�����l�L�32�9;���*E�Fr/c�N�d\}}tj|d|zddg�}tj||ddg�}tjdtj��}gd�gd�g}tjdd	g�}tjdd	tj
zd
�D�]z}tj|�|ztj|�|zz}tj|�|ztj|�|zz}	tj||	|�}
tj|
|d��}tjj|�}|j�}
tj|
d
�d
z
|ddd�f<td�D]/}tj|
d
�d	|
dd�|fzz
||d
zdd�f<�1t!tj"tj$|�d��tjddgtj�����}y)N)rIgˡE��?r�rIrJrHr�rr�rr�rrr
rrr�)rKr�r�rNrMr9r8r:rrrrf�_DOF_estimator_geom�compute_geom_weightsr�rMrrPr")r�rOr+r,r$r�sum_w�theta�x_rot�y_rotr\r'�
dof_estimator�weights�itris               r-� test_triinterpcubic_geom_weightsr}�s���
�H�R��
���"�c�"�f�b�"�%�&�A�
���"�r�c�2�r�"�#�A�
����"�*�*�%�A��I�&�I��H�H�a��V��E����R��2�5�5��"�-�H�����u�
�a��"�&�&��-��/�1��������q� �2�6�6�%�=��?�2���#�#�E�5�)�<���.�.�v�q�v�F�
��+�+�?�?�
�K�
��4�4�6���f�f�W�a�(�1�,��a��d���!�H�	G�D�!�v�v�g�q�1�A�g�a��g�6F�4F�F�E�$�q�&�!�)��	G�!�"�&�&������Q�"?�"$�(�(�B��8�2�:�:�"F�	H�Hr/c�8�d}tjgd��}tjddddd|dg�}ddgddgddgddgddgddgg}|D�]�}|d|z|d|zz}|d|z|d|zz}||}}d|zd	|zz
}	gd
�gd�gd�gd
�gd�gd�gd�gd�g}
tj|||
�}tjtj
|j�tj|j�d�}tjtj
|j�tj|j�d�}
tj||
�\}}
|j�}|
j�}
|j�||
�dk(}tjjd|zd	|
zz
|��}tj||	�}tj||	�}tj||	d��}|||fD]}|||
�}t||��d}|j |df}|j |df}tj|j||j|d�}tj|j||j|d�}
d|zd	|
zz
}|||fD]J}|j#||
|tj$dtj&��z��\}t||��L���y)NrIr�rrr
r���rrr9r�r�r�r�r�r�r��rrrrHr_r�)�	tri_index)rKr�rrrMrPr+rQr,rLrNr��marrrr�_interpolate_multikeysrZr�)r�rb�y0�transformations�transformationrxryr+r,r$rr\r�r��mask_out�	zs_targetr%r&r'r(r)r|�pt1�pt2s                        r-�test_triinterp_colinearr��s���
�E�	���1�	2�B�	���2��A��1�e�Q�/�	0�B��1�v��1�v��1�v��1�v��B�x�"�a��I�O�)�#5���q�!�"�$�~�a�'8��';�;����"�"�2�%��q�(9�"�(<�<����A����F�T�!�V�O���	�9�i���	�9�6�	��#�#�A�q�)�4��
�[�[�������)�2�6�6�&�(�(�+;�R�
@��
�[�[�������)�2�6�6�&�(�(�+;�R�
@�����R��$���B�
�X�X�Z��
�X�X�Z��*�F�(�(�*�2�r�2�b�8���E�E�K�K��R��$�r�'� 1��K�A�	��2�2�6�1�=�
��/�/���:���.�.�v�q�v�F�
�$�k�:�>�	5�F���B��B�%�i��4�	5������t�Q�w�'�����t�Q�w�'��
�[�[����#������
�r�
:��
�[�[����#������
�r�
:����G�d�2�g�%�	�$�k�:�>�	5�F��/�/��B�$�r�w�w�r����'B�"B�0�D�C�B�%�i��4�	5�A#5r/c��d}d}d}d�}tj|d|�}tjd|zdtjz|z|d�	�}tj|d
tjf|d��}|dd�ddd�fxxtj|zz
cc<|tj
|�zj
�}|tj|�zj
�}tj||�}|||�}	tjd
dd�}
tjd
dd�}tj|
|�\}
}|
j�}
|j�}i}td�D�]�}
dtjz|z|
z}tj
|�|ztj|�|zz}tj|�|ztj
|�|zz}tj
|�|
ztj|�|zz}tj|�|
ztj
|�|zz}tj|||j�}tj||	�}tj||	�}tj||	d��}|||d�}dD];}||}|
dk(r
||
|�||<�|||�}t!j"|||��=���d}dD]�}|dk(r||z}|}||
z}|}n|}||z}|
}||z}tj|||j�}tj||	�}tj||	�}tj||	d��}|||d�}dD]'}||||�}t!j"|||��)��y)Nr�r_�333333�?c��tjd|z
d|z
�}tjd|z
d|z
�}tj|dz
|dz
�}tj|dz
|dz
�}dtj|dzdz�dz
zdztjd|z�ztj|dzdz�dz
dztjd|z�zzd	|dz|dzzzz}tj
|�|z
tj
|�tj|�z
zS�
Nr�r�rr_r
g>@�@g&@rt�rK�hypot�arctan2�expr8rQrP�r+r,�r1�theta1�r2�theta2r$s       r-r$z)test_triinterp_transformations.<locals>.z��"��
�X�X�c�A�g�s�Q�w�
'�����C�!�G�S�1�W�-��
�X�X�q�b�3�h���S��
)�����Q�B��H�q�b�3�h�/�������B���
�#�A�%�&�s�*�R�V�V�B�v�I�->�>��v�v�r�"�u�q�j�!�!�#�S�(�2�6�6�#�f�*�+=�=�>��1�a�4�!�Q�$�;�� �
!�����q�	�!��b�f�f�Q�i����q�	�1�2�2r/�ffffff�?rrF��endpoint.r
r���rJrarr)�lin�min_Erg�Z�$.ArDr+)rKrMr9�repeat�newaxisr8�flattenr:rrrLrNrMrrrrr)�n_angles�n_radii�
min_radiusr$�radii�anglesrbr��triang0�z0�xs0�ys0�	interp_z0�i_anglerwr+r,r�r�r\r%r&r'�
dic_interp�
interp_keyr(�interpz�scale_factor�scaled_axiss                             r-�test_triinterp_transformationsr��s����H��G��J�3�
�K�K�
�D�'�2�E�
�[�[��X��q����w��'9�!�E�3�F�
�Y�Y�v�c�2�:�:�o�.��a�
@�F�
�1�a�d��d�7�O�r�u�u�X�~�%�O�
����v��
�	'�	'�	)�B�
����v��
�	'�	'�	)�B�� � ��R�(�G�	
�2�r��B�
�+�+�c�2�r�
"�C�
�+�+�c�2�r�
"�C��{�{�3��$�H�C��

�)�)�+�C�

�)�)�+�C��I���8�H���"�%�%��(�"�W�,���F�F�5�M�"��r�v�v�e�}�R�/�/��
�V�V�E�]�N�2�����u�
�b� 0�0��
�V�V�E�]�3�
������s�!2�
2���f�f�U�m�^�C�
�"�&�&��-��"3�
3���#�#�A�q�'�*;�*;�<���2�2�6�2�>�
��/�/���;���.�.�v�r��G�
�*�*�(�*�
�3�	H�J��
�+�F��!�|�(.�s�C�(8�	�*�%� ��R�.���0�0��1:�:�1F�H�
	H�H�0�L�!�M���#���r�!�A��A���#�B��B��A��r�!�A��B���#�B��#�#�A�q�'�*;�*;�<���2�2�6�2�>�
��/�/���;���.�.�v�r��G�
�*�*�(�*�
�3�	M�J�,�j��,�R��4�G��,�,�W�i�
�6K�L�	M�)Mr/ztri_smooth_contouring.pngTg;�O��n�?)�remove_textrcc���d}d}d}d�}tj|d|�}tjd|zdtjz|z|d�	�}tj|d
tjf|d��}|dd�ddd�fxxtj|zz
cc<|tj
|�zj
�}|tj|�zj
�}tj||�}|||�}	|jtj||jjd��||jjd���|k�tj|�}
|
j|	d
��\}}tj ddd�}
t#j$|dd��t#j&|||
d��y)Nr�r_r�c��tjd|z
d|z
�}tjd|z
d|z
�}tj|dz
|dz
�}tj|dz
|dz
�}dtj|dzdz�dz
zdztjd|z�ztj|dzdz�dz
dztjd|z�zzd	|dz|dzzzz}tj
|�|z
tj
|�tj|�z
zSr�r�r�s       r-r$z%test_tri_smooth_contouring.<locals>.zUr�r/r�rrFr�.r
r�rH��subdivrIrJg�������?r�z0.5)�lw�color�black)�levels�colors)rKrMr9r�r�r8r�r:rrr�r�rr��UniformTriRefiner�refine_fieldrVr��triplot�
tricontour)r�r�r�r$r�r�rbr�r�r��refiner�tri_refi�z_test_refir�s              r-�test_tri_smooth_contouringr�Ns����H��G��J�3�
�K�K�
�D�'�2�E�
�[�[��X��q����w��'9�!�E�3�F�
�Y�Y�v�c�2�:�:�o�.��a�
@�F�
�1�a�d��d�7�O�r�u�u�X�~�%�O�
����v��
�	'�	'�	)�B�
����v��
�	'�	'�	)�B�� � ��R�(�G�	
�2�r��B����R�X�X�b��!2�!2�3�8�8�a�8�@� ��!2�!2�3�8�8�a�8�@�B�!�"�#�
�$�$�W�-�G�#�0�0��A�0�>��H�k�
�Y�Y�r�2�u�
%�F��K�K��C�u�-��N�N�8�[���Hr/ztri_smooth_gradient.pnggZd;�O��?c
�p�d�}d}d}d}tj|d|�}tjddtjz|d�	�}tj|d
tjf|d��}|dd�ddd�fxxtj|zz
cc<|tj
|�zj
�}|tj|�zj
�}|||�}tj||�}	|	jtj||	jjd��||	jjd���|k�tj|	�}
|
j|d
��\}}tj |	|�}
|
j#|	j$|	j&�\}}tj||�}t)j*�t)j,�j/d�t)j0|	d��tj2ddd�}t4j6d}t)j8||||gd���t)j:|	j$|	j&||z||zddd
dddd��y)Nc��|dz|dzz}tj||�}tj|�|z}tj|�|z
tj|�tj|�z
zS)zAn electric dipole potential V.r)rKr�r8rQrP)r+r,�r_sqrwr$s     r-�dipole_potentialz2test_tri_smooth_gradient.<locals>.dipole_potentialysa���!�t�a��d�{���
�
�1�a� ���F�F�5�M�$������q�	�!�����q�	�"�&�&��)� 3�4�4r/�r_r�r�rrFr�.r
r�rr��equalz0.8)r�rIrJg{�G�z�?�hot)rkrJrJrJ)r��cmap�
linewidthsr}ri�bluegy�&1�|?r�rL)�units�scale�zorderr��width�	headwidth�
headlength)rKrMr9r�r�r8r�r:rrr�r�rr�r�r�rr r+r,r�r��gca�
set_aspectr�rV�mpl�	colormapsr��quiver)r�r�r�r�r�r�r+r,�Vr\r�r�r��tci�Ex�Ey�E_normr�r�s                   r-�test_tri_smooth_gradientr�us7��5��H��G��J��K�K�
�D�'�2�E�
�[�[��A�b�e�e�G�X��
>�F�
�Y�Y�v�c�2�:�:�o�.��a�
@�F�
�1�a�d��d�7�O�r�u�u�X�~�%�O�	�r�v�v�f�~�	�&�&�(�A�	�r�v�v�f�~�	�&�&�(�A���A��A�
�
�
��1�
%�F�
�O�O�B�H�H�Q�v�/�/�0�5�5�1�5�=��v�/�/�0�5�5�1�5�=�?� �!�"�
�$�$�V�,�G�#�0�0��1�0�=��H�k��
#�
#�F�Q�B�
/�C�
�\�\�&�(�(�F�H�H�
-�F�B��
�X�X�b�"�
�F��J�J�L��G�G�I����!��K�K��e�$�
�Y�Y�r�2�t�
$�F��=�=���D��N�N�8�[��d�2�4��J�J�v�x�x����2�f�9�b��i���Q�f��b�R�9r/c��tjgd��}tjdddtjd�zddg�}tjgd�gd�gd	�gtj�
�}tjgd�t�
�}tj||||��}tj|�}t|jtjddddtjd�zzzg��t|jd
��tjjdddtjd�zztjg|��tjgd��}tjgd��}tjgd�gtj�
�}tj|||�}tj|�}t|j�tjdg��d}d�}tjdd|dz�}tj||d�||d��\}}|j!�}|j!�}tj||t#|dz���}tj|�}|j%d�}tj&dt�
�}	gd�}
d|	|
<t)||	�tj&dt�
�}d|d<|j+|�|j%d�}gd�}d|	|<t)||	�y)N�rIrJr�rIrkrIr�r�r�rJrr�r�r��FFTrF)�rescalerk)rIrJrk)rJrLr�r�c�^�tj|�|ztj|�zSrq)rKr"�sign)r+rs  r-�powerztest_tritools.<locals>.power�s!���v�v�a�y�!�|�B�G�G�A�J�&�&r/r
r�rr��)rr
rrr�r�r�r����"�#�~�����������T�P)�,�-�>�?�N�Or��Q�R�S�br@�t�u)rKr��sqrtr��boolrr�TriAnalyzerr�
scale_factors�
circle_ratiosr��masked_array�nanrMrLrNr!�get_flat_tri_maskr�rr�)r+r,rrr\�analyserr0r��	mask_flat�
verif_mask�
corners_index�center_indexs            r-�
test_tritoolsr�s���	���&�'�A�
���"�b�#�b�g�g�b�k�/�3��3�4�A����)�Y�	�:�"�(�(�K�I�
�8�8�(��5�D�
�
�
��1�i�d�
;�F�����'�H��h�4�4� �h�h��B��3�r�w�w�r�{�?�0B�,C�'D�E�G�����u��-�
�����C��R������^�!4�b�f�f�=�t�D�F�
	�����A�
���#�$�A����)��B�H�H�5�I�
�
�
��1�i�
0�F�����'�H��h�4�4�6����"���G�	
�A�'�	���C��Q�q�S�!�A�
�;�;�u�Q��|�U�1�d�^�4�D�A�q�	���	�A�	���	�A�
�
�
��1�0B�1�Q�3�0G�
H�F�����'�H��*�*�3�/�I����#�T�*�J�G�M� $�J�}���y�*�-��8�8�C�t�$�D��D��H�
�O�O�D���*�*�3�/�I�M�L�#�J�|���y�*�-r/c���d}d}tjdd|dz�}tj||�\}}|j�}|j�}tjd|dzzt
��}d||dzdt
j||t|dz�|��}t
j|�}|j|�	�}|j}|j}	||dzz}
tjdd|
dz�}tj||�\}}|j�}|j�}tjtj|d
|zzd�tj|d
|	zzd��}
t|
d�|j }tj"|j|j$d��d
z}tj"|j|j$d��d
z}|j'�}|||�}|j |}t||�tj(gd��}tj(gd��}t
j||gd�gd�g�t
j||gd�gd�g�g}tj*|dz
|dz
�}g}t-d�D]�}t
j||�}|j/|d�	�\}}tj0|j|j|f�d}|tj2|dd�df|dd�dff�}||gz
}��t5|d|d�y)Nrrr�rJr
r�Trr�r�r�r�r��rIrJrIrJ�rIrIrJrJr�r��rrrrr�r)rKrMrLrNr�rrrr!r��refine_triangulationr+r,�in1d�aroundrrr�rr�r�r�rMr��dstack�lexsortr)r0r�r+r,rr\r��refi_triang�x_refi�y_refi�n_refi�x_verif�y_verif�ind1d�	refi_mask�refi_tri_barycenter_x�refi_tri_barycenter_y�
tri_finder�refi_tri_indices�
refi_tri_maskr$�xyz_data�i�refined_triang�	refined_z�xyzs                          r-�test_trirefiner0�s��	�A�
�F�
���C��Q�q�S�!�A�
�;�;�q�!��D�A�q�	���	�A�	���	�A�
�8�8�A�a��d�F�$�'�D��D��A���K�
�
�
��1�0B�1�Q�3�0G�%)�+�F��$�$�V�,�G��.�.�f�.�=�K�
�]�]�F�
�]�]�F�
����]�F��k�k�#�r�6�!�8�,�G��{�{�7�G�4��G�W��m�m�o�G��m�m�o�G��G�G�B�I�I�g�s�7�{�3�Q�7��I�I�f�c�&�j�1�1�5�
7�E��u�d�#�� � �I��F�F�;�=�=��1F�1F�#G�()�+�-/�0���F�F�;�=�=��1F�1F�#G�()�+�-/�0���%�%�'�J�!�"7�"7�9���K�K� 0�1�M��y�-�0�	�
�
�'�(�A�
�
�
�'�(�A�� � ��A�	�9�'=�>�� � ��A�	�9�'=�>�@�F�
����S��!�c�'�"�A��H�
�1�X����(�(����3��$+�$8�$8��1�$8�$E�!��	��i�i��)�)�>�+;�+;�Y�G�H��K���"�*�*�c�!�Q�$�i��Q��T��3�4�5���S�E�����h�q�k�8�A�;�7r/r;�linear�cubic)�idsc��tjdd�dd�f\}}tj|j�d�}tj|j�d�}tj|�}tj||�}tj|�}|||�}|j||d��y)Nr)�triinterpolatorr�)	rK�mgridr�r��
zeros_likerrr�r�)r;r+r,r$r�r�r(s       r-�test_trirefine_maskedr8s����8�8�B�Q�B����F��D�A�q�
�	�	�!�)�)�+�q�!�A�
�	�	�!�)�)�+�q�!�A�
�
�
�a��A�
�
�
�Q��
"�C��$�$�S�)�G�
�#�q�
!�F�����F�1��=r/c��g}t|dz
�D]N}t|dz
�D];}|||zz}|dz||zz}||dz|zz}|dz|dz|zz}||||g|||ggz
}�=�Ptj|tj��S)zU
    Return (2*(N-1)**2, 3) array of triangles to mesh (N, N)-point np.meshgrid.
    r
r�)rMrKr�r�)r0r�r,�jrrr��ds        r-r!r!-s���
�C�
�1�Q�3�Z�*���q��s��	*�A��A�a�C��A��1���!���A��Q�q�S�!�G��A��1���1��a���A��Q��1�I��1�a�y�)�)�C�	*�*��8�8�C�r�x�x�(�(r/c��tj�j�}tjgd�gd�gd�gd�g��}|j|d��Jd��y)Nrrr�r�rzb-z(triplot should return the artist it adds)r�r�r�rrr�)r�r\s  r-�test_triplot_returnr=<sW��	����	!�	!�	#�B�
�
�
��2��i�(�*�F��:�:�f�d�#�/�3�2�3�/r/c�Z�tjgd�gd�g�}tj|�rJ�tj|dd��}tj|�sJ�tjgd��}tjgd��}tj|||�}tj|||�}tj
|�}tj
|�}|j
d�	�}|j
d�	�}	t|j|	j�y)
Nr)rr
rT�F)r��order)g�(\���?g�z�G��?g��Q���?g{�G�z�?)g��Q��@@g�z�GA@g���QA@gףp=
A@r
r�)	rKr��	isfortranrrr�rrr)
�
triangles1�
triangles2r+r,�triang1�triang2�refiner1�refiner2�fine_triang1�fine_triang2s
          r-�,test_trirefiner_fortran_contiguous_trianglesrJFs������9�i�0�1�J��|�|�J�'�'�'����*�4�s�;�J�
�<�<�
�#�#�#�
���)�*�A�
���-�.�A�� � ��A�z�2�G�� � ��A�z�2�G��%�%�g�.�H��%�%�g�.�H��0�0��0�:�L��0�0��0�:�L��|�-�-�|�/E�/E�Fr/c�@�tjddd�}ttjtj||��\}}||dz
kD|dkz|dkDz}||||}}tj
d�}|tj|�z|tj|�zz
}|tj|�z|tj|�zz}tj||�}|j}d|_|j}	t||	�y)Nrrrr
g333333��g333333��)
rKrM�maprNrL�radiansr8r:rrrSrTr)
�xir+r,�wrw�x1�y1r\�qhull_neighbors�
own_neighborss
          r-�test_qhull_triangle_orientationrU]s���	���R��C�	 �B��r�x�x����R��,�-�D�A�q�	
�Q��U��q�5�y�!�Q��X�.�A��Q�4��1��q�A��J�J�r�N�E�	
�2�6�6�%�=��1�R�V�V�E�]�?�	*�B�	
�2�6�6�%�=��1�R�V�V�E�]�?�	*�B��
�
��B�
'�F��&�&�O��F���$�$�M���
�6r/c��tjgd��}tjdddtjd�zddg�}tjgd�gd�gd	�gtj�
�}tjgd�t�
�}tj||||��}tj|�}|j�y)
Nr�rIr�r�r�rJrr�r�r�r�r)	rKr�rr�rrrr	�_get_compressed_triangulation)r+r,rrr\rs      r-�#test_trianalyzer_mismatched_indicesrXts���
���&�'�A�
���"�b�#�b�g�g�b�k�/�3��3�4�A����)�Y�	�:�"�(�(�K�I�
�8�8�(��5�D�
�
�
��1�i�d�
;�F�����'�H�
�*�*�,r/c���gd�}gd�}gd�}tj�tjt�5tj
|||ddg�ddd�y#1swYyxYw)N)rIrJrJ)rIrIrJ)r�r�rrJrI)r�r�r3rBrC�tricontourf)r+r,r$s   r-�"test_tricontourf_decreasing_levelsr[�sQ���A��A��A��J�J�L�	���z�	"�-�����1�a�#�s��,�-�-�-�s�A�A'c
�	�ddlm}tjtd��5t
jj
�ddd�tjtd��5t
jj
gdgggdddd�ddd�gd�}gd	�}tjtd
��5t
jj
||ddggdddd�ddd�gd�g}tjtd��5t
jj
|||ddgddd�ddd�tjtd
��5t
jj
|||ddggdd�ddd�tjtd��5t
jj
|||dddggd�ddd�t
jj
|||dddd�}tjtd��5|jg�ddd�tjtd��5|jddg�ddd�tjtd��5t
jj�ddd�tjtd��5t
jj|dg�ddd�gd�}t
jj||�}tjtd��5|jdd�ddd�tjtd��5t
jj�ddd�t
jj|�}tjtd��5|jdgddg�ddd�y#1swY���xYw#1swY��^xYw#1swY��xYw#1swY���xYw#1swY���xYw#1swY��XxYw#1swY��xYw#1swY���xYw#1swY���xYw#1swY��txYw#1swY��'xYw#1swY��xYw#1swYyxYw)Nr)�_triz.function takes exactly 7 arguments \(0 given\)r=z,x and y must be 1D arrays of the same lengthr
F)rr
r
r:z.triangles must be a 2D array of shape \(\?,3\)rzCmask must be a 1D array with the same length as the triangles arrayz,edges must be a 2D array with shape \(\?,2\)zGneighbors must be a 2D array with the same shape as the triangles arrayrz<z array must have same length as triangulation x and y arrayz.function takes exactly 2 arguments \(0 given\)z?z must be a 1D array with the same length as the x and y arraysz(filled contour levels must be increasingz-function takes exactly 1 argument \(0 given\)z*x and y must be array-like with same shape)�
matplotlibr]r3rBr�r�rrC�calculate_plane_coefficientsr��TriContourGenerator�create_filled_contour�TrapezoidMapTriFinder�	find_many)r]r+r,r�r\r$�tcgr�s        r-�test_internal_cpp_apire�s����
����C�
E�!�	����� �!�

����M�
O�G������r�A�3���d�D�$��F�G�	�A��A�	����C�
E�H�	�����q�!�q�!�f�X�t�T�4��G�H�

�;�D�	����%�
&�F�	�����q�!�T�A�q�6�4��u�E�	F�
����M�
O�E������q�!�T�4�1�#���e�D�E�
����%�
&�F�	�����q�!�T�4����v�u�E�	F��X�X�
#�
#�A�q�$��d�D�%�
H�F�	�����
�0�	�+�+�B�/�	0�
����%�
&� �	����A���	 �
����C�
E�'�	���$�$�&�'�

�����
�2�	���$�$�V�a�S�1�	2�	�A�

�(�(�
&�
&�v�q�
1�C�	����I�
K�(��!�!�!�Q�'�(�

����M�
O�)����&�&�(�)����.�.�v�6�I�	����K�
M�)����Q�C�!�Q��(�)�)�S!�!��
G�G��H�H��F�F��E�E��F�F��0�0�� � ��'�'��
2�2��(�(��
)�)��)�)�s��O�$(O(�7)O5�(P�(P�(P�P)�P6�:Q�<"Q�%Q�Q*�<Q6�O%�(O2�5O?�P�P�P&�)P3�6Q�Q
�Q�Q'�*Q3�6Q?c�"�tjgd��}tjgd��}d}tj||�}tj||z||z�}t	|j
�t	|j
�k(sJ�y)N)rr
rr
r�)rrr
r
r�g _�B)rKr�rrrOr)r+r,�offsetr\�
triang_offsets     r-�test_qhull_large_offsetri�su��
�
�
�$�%�A�
�
�
�$�%�A�
�F�
�
�
��1�
%�F��&�&�q�6�z�1�v�:�>�M��v��� �C�
�(?�(?�$@�@�@�@r/c	�N�gd�}gd�}tj||�}tj�t	j
td��5tj|dddtjg�ddd�t	j
td��5tj|dddtjg�ddd�t	j
td��5tj|dddtjg�ddd�t	j
td��5tj|tjjgd	�gd
����ddd�y#1swY��xYw#1swY��xYw#1swY��xYw#1swYyxYw)Nr�r�zCz array must not contain non-finite values within the triangulationr=rr
rz9z must not contain masked points within the triangulation)rr
rr)r
rrrr)
rrr�r�r3rBrCrZrK�infr
r�r�)r+r,r\s   r-�test_tricontour_non_finite_zrl�sQ���A��A�
�
�
��1�
%�F��J�J�L�	���z�*K�
L�3������A�q�"�&�&� 1�2�3�
���z�*K�
L�4������A�q�2�6�6�'� 2�3�4�
���z�*K�
L�3������A�q�"�&�&� 1�2�3�
���z�*D�
E�N����������L�|�� L�M�N�N�3�3��4�4��3�3��N�N�s0�)E6�*F�')F�3:F�6F�F�F�F$c�&�gd�}gd�}gd�}tj�\}}|j|||�}|j|||�}|j|jk7sJ�|j||�}|j|jk(sJ�y)N)rIr�rJ)rIrJrI)rJrkr�)r�r�rZr��_contour_generator)r+r,r$r�r��tcs1�tcs2�tcs3s        r-�test_tricontourset_reuserrs���	�A��A��A��l�l�n�G�C��
�>�>�!�Q��"�D�
�=�=��A�q�!�D��"�"�d�&=�&=�=�=�=�
�=�=��q�!�D��"�"�d�&=�&=�=�=�=r/c��gd�}gd�}gd�g}|j�j|||d��|j�j|||d��y)Nr9r:rz--)�ls)�	linestyle)r�r�)�fig_test�fig_refr+r,�datas     r-�test_triplot_with_lsrysS���A��A��;�D��������1�d�t��4�������q�!�T�T��:r/c���gd�}gd�}gd�g}tj�\}}|j|||d��\}}|j�\}}|dgk(sJ�t	|�dk(sJ�|d|usJ�y)Nr9r:r�label)r{r
r)r�r�r��get_legend_handles_labelsrO)	r+r,rxr�r��lines�markers�handles�labelss	         r-�test_triplot_labelr�s����A��A��;�D��l�l�n�G�C���Z�Z��1�d�'�Z�:�N�E�7��2�2�4�O�G�V��g�Y�����w�<�1�����1�:����r/)A�numpyrK�
numpy.testingrrr�numpy.ma.testutilsr��	testutilsrr3r^r��matplotlib.pyplot�pyplotr��matplotlib.trir�r�matplotlib.pathr�matplotlib.testing.decoratorsrrr
r;rEr]rgrnr4r5rrr�r�r�r�r�r�r�r3rVrrr}r�r�r�r�rr0rrr8r!r=rJrUrXr[rerirlrrryr�r7r/r-�<module>r�s���F�F�#�#�
���� �O�'�'�:�/�('H�TA�(���������H��S�1�#�J���V�a��V���	���	���+�,�
"�
�!�
�!�
*F�Z�#�$�%��&��6*�8*�=�1�d.�N\6�~SG�lKF�\H�4;5�|ZM�z�.�/�T�u�M�#I�N�#I�L�,�-�4�U�K�/9�L�/9�h6.�r58�p�������4�4��3�3�5�&��0��2�>�	2�>�)�3�G�.7�.
-�-�P)�fA�N�0>���;��;�	r/

Youez - 2016 - github.com/yon3zu
LinuXploit