403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/scipy/io/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/io/tests/__pycache__/test_fortran.cpython-311.pyc
�

d�c�����dZddlZddlZddlmZddlmZddlZddlm	Z	m
Z
ddlZddl
Z
ddlmZmZmZmZejeje��d��Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Z d�Z!dS)z$ Tests for fortran sequential files �N)�path)�iglob)�assert_equal�assert_allclose)�FortranFile�
_test_fortran�FortranEOFError�FortranFormattingError�datac�:�ttjtd����D�]q}t	jd|tj��}|std|z���t|�	d����t|�	d����t|�	d����f}|�	d���
dd	��}t|d
d��}|�|����
|d
���}|���tjtj|�����
|���|��}t'||����sdS)N�fortran-*-*x*x*.dat�%fortran-([^-]+)-(\d+)x(\d+)x(\d+).dat�#Couldn't match %s filename to regex�����s�<�r�<u4��dtype�F)�order)rr�join�	DATA_PATH�re�search�I�RuntimeError�int�group�replacer�read_record�reshape�close�np�arange�prod�astyper)�filename�m�dimsr�fr�expecteds       �=/usr/lib/python3/dist-packages/scipy/io/tests/test_fortran.py�test_fortranfiles_readr2sH���$�)�I�/D�E�E�F�F�%�%���I�>��"�$�O�O���	Q��D�x�O�P�P�P��A�G�G�A�J�J����Q�W�W�Q�Z�Z���#�a�g�g�a�j�j�/�/�B������
�
�"�"�3��,�,����#�u�-�-���}�}�5�}�)�)�1�1�$�c�1�B�B��	���	�	�	��9�R�W�T�]�]�+�+�3�3�D�9�9�@�@��G�G���T�8�$�$�$�$�%�%�c��tjtd��}t|dd��5}|�d��}ddd��n#1swxYwYt|ddd��t
|ddd	��t|d
dd��t
|ddd
dg��dS)Nzfortran-mixed.datrrz<i4,<f4,<i8,(2)<f8�f0rr�f1gffffff@�f2r�f3gffffff@g333333@)rrrrr%rr)r,r/�records   r1�test_fortranfiles_mixed_recordr:(s����y��$7�8�8�H�	�X�s�E�	*�	*�5�a����3�4�4��5�5�5�5�5�5�5�5�5�5�5����5�5�5�5�����a��!�$�$�$��F�4�L��O�S�)�)�)�����a��!�$�$�$��F�4�L��O�c�3�Z�0�0�0�0�0s�A�A�Ac���ttjtd����D�]6}t	jd|tj��}|std|z���t|�	d����t|�	d����t|�	d����f}|�	d���
dd	��}tjtj
|�����|���|��}t!j��}	tj|tj|����}t'|d
d��}|�|j��|���t/|d��}t/|d��}	t1|���|	���|�
��|���|	���t5j|����#t5j|��wxYwdS)Nr
rrrrrrrr�wr�rb)�err_msg)rrrrrrr r!r"r#r$r(r)r*r&r+�tempfile�mkdtemp�basenamer�write_record�Tr'�openr�read�shutil�rmtree)
r,r-r.rr�tmpdir�testFiler/�originalfile�newfiles
          r1�test_fortranfiles_writerL3s����$�)�I�/D�E�E�F�F�"�"���I�>��"�$�O�O���	Q��D�x�O�P�P�P��A�G�G�A�J�J����Q�W�W�Q�Z�Z���#�a�g�g�a�j�j�/�/�B������
�
�"�"�3��,�,���y������'�'�/�/��5�5�<�<�U�C�C���!�#�#��	"��y���
�h�(?�(?�@�@�H��H�c�%�0�0�A�
�N�N�4�6�"�"�"�
�G�G�I�I�I���$�/�/�L��8�T�*�*�G���*�*�,�,�g�l�l�n�n�!)�
+�
+�
+�
+���� � � ��M�M�O�O�O��M�&�!�!�!�!��F�M�&�!�!�!�!����-"�"s
�
C$I�Ic���tjtd��}t|dd��5}|�dd��}ddd��n#1swxYwYtjd���dd���t
j	��}tj
dd	gt
j�
��}t|d|j
��t|d|j
��dS)
Nzfortran-3x3d-2i.datrrz(3,3)<f8z2<i4�	r������rrr)rrrrr%r(r)r&r+�double�array�int32rrC)r,r/r9�ax�bxs     r1�"test_fortranfile_read_mixed_recordrVMs���y��$9�:�:�H�	�X�s�E�	*�	*�3�a����z�6�2�2��3�3�3�3�3�3�3�3�3�3�3����3�3�3�3�
��3���	�	��1�	%�	%�	,�	,�R�Y�	7�	7�B�	��2�r�(�"�(�	+�	+�	+�B�����B�D�!�!�!�����B�D�!�!�!�!�!s�A�A�Ac��tjt|��d��}dtjd��tjd��tjd��ffdtj�ddg�	���tj��tj�dddg�	���tj��tj�dd
g�	���tj��ffg}|D]�\}}t|d��5}|j
|�ddd��n#1swxYwYt|d��5}|j|�}ddd��n#1swxYwYtt|��t|����t||��D]\}}t||�����dS)
N�test.dat)�f4rY�i4rr�d)�4f4z(3,3)f4�8i4�r)�size�r<r)rr�strr(�float32rS�random�randintr+rrBr%r�len�zip)	rH�tf�recordsr�ar/�b�aa�bbs	         r1�#test_fortranfile_write_mixed_recordrmds,��	
��3�v�;�;�
�	+�	+�B�
�b�j��m�m�R�Z��]�]�B�H�S�M�M�J�K�	"�R�Y�%6�%6�s�!��%6�%E�%E�%L�%L�R�Z�%X�%X�%'�Y�%6�%6�s�!�Q��%6�%H�%H�%O�%O�PR�PZ�%[�%[�%'�Y�%6�%6�s�!��%6�%E�%E�%L�%L�R�X�%V�%V�%X�	Y��G��
!�
!���q�
��S�
!�
!�	�Q��A�N�A���	�	�	�	�	�	�	�	�	�	�	����	�	�	�	���S�
!�
!�	&�Q���
�u�%�A�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	�S��V�V�S��V�V�$�$�$��!�Q�i�i�	!�	!�F�B����R� � � � �	!�
!�
!s$�6E
�
E	�E	�(E?�?F	�F	c���tjt|��d��}tj�d��d\}}}tj�|||��}t|d��5}|�|j	��ddd��n#1swxYwYtj||||��}t|d��5}|�d��j	}ddd��n#1swxYwYt||��t||��d\}}}tj�|||���tj��}t|d��5}|�|j	��ddd��n#1swxYwYtj||||��}t|d��5}|�d��j	}ddd��n#1swxYwYt||��t||��d\}}}tj�||��}tj�|���tj��}	t|d��5}|�|j	|	j	��ddd��n#1swxYwYtj||||��\}}
t|d��5}|�dd	��\}}|j	}ddd��n#1swxYwYt||��t||��t|
|	��t||	��dS)
NrXr)�rrr<rz	(2,3,5)f8z	(2,3,5)i4z(3,5)f8�2i4)rrrar(rc�seed�randnrrBrCr�read_unformatted_doubler%rr+rS�read_unformatted_int�intc�read_unformatted_mixed)rHr,r-�n�krir/�a2�a3rj�b2�b3s            r1�test_fortran_roundtripr}{sj���y��V���j�1�1�H��I�N�N�1�����G�A�q�!�
�	����1�a� � �A�	�X�s�	#�	#��q�	���q�s����������������������	�	.�q�!�Q��	A�	A�B�	�X�s�	#�	#�*�q�
�]�]�;�
'�
'�
)��*�*�*�*�*�*�*�*�*�*�*����*�*�*�*���Q������Q�����G�A�q�!�
�	����1�a� � �'�'���1�1�A�	�X�s�	#�	#��q�	���q�s����������������������	�	+�A�q�!�X�	>�	>�B�	�X�s�	#�	#�*�q�
�]�]�;�
'�
'�
)��*�*�*�*�*�*�*�*�*�*�*����*�*�*�*���Q������Q�����G�A�q�!�
�	����1���A�
�	������!�!�"�'�*�*�A�	�X�s�	#�	#�!�q�	���q�s�A�C� � � �!�!�!�!�!�!�!�!�!�!�!����!�!�!�!�
�
1�!�Q��8�
D�
D�F�B��	�X�s�	#�	#��q����y�%�0�0���B�
�T����������������������Q������Q������Q������Q�����sl�9B � B$�'B$�C9�9C=�C=�8F�F#�&F#�G8�8G<�?G<�!K�K�	K�7!L$�$L(�+L(c��tjt|��d��}tj�d��t
|d��5}|�tj�d����|�tj�d����ddd��n#1swxYwYt
|d��5}t|�
����dksJ�t|�
����dksJ�tjt��5|�
��ddd��n#1swxYwYddd��dS#1swxYwYdS)N�scratchrr<rorr)rrrar(rcrqrrBrrre�
read_reals�pytest�raisesr	�rHr,r/s   r1�test_fortran_eof_okr��s����y��V���i�0�0�H��I�N�N�1����	�X�s�	#�	#�+�q�	���r�y���q�)�)�*�*�*�	���r�y���q�)�)�*�*�*�+�+�+�+�+�+�+�+�+�+�+����+�+�+�+�
�X�s�	#�	#��q��1�<�<�>�>�"�"�a�'�'�'�'��1�<�<�>�>�"�"�a�'�'�'�'�
�]�?�
+�
+�	�	�
�L�L�N�N�N�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	���������������������sJ�A%C�C�
C�A(E?�E'�E?�'E+	�+E?�.E+	�/E?�?F�Fc��tjt|��d��}tj�d��t
|d��5}|�tj�d����|�tj�d����ddd��n#1swxYwYt|d��5}|�
d��ddd��n#1swxYwYt
|d��5}t|�����dksJ�t|�����dksJ�tjt��5|���ddd��n#1swxYwYddd��dS#1swxYwYdS)	Nrrr<ror�ab��r)rrrar(rcrqrrBrrrD�writerer�r�r�r
r�s   r1�test_fortran_eof_broken_sizer��sk���y��V���i�0�0�H��I�N�N�1����	�X�s�	#�	#�+�q�	���r�y���q�)�)�*�*�*�	���r�y���q�)�)�*�*�*�+�+�+�+�+�+�+�+�+�+�+����+�+�+�+�
�h��	�	���	�������������������������	�X�s�	#�	#��q��1�<�<�>�>�"�"�a�'�'�'�'��1�<�<�>�>�"�"�a�'�'�'�'�
�]�1�
2�
2�	�	�
�L�L�N�N�N�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	���������������������s\�A%C�C�
C�D�D�D�A(F<�F$�F<�$F(	�(F<�+F(	�,F<�<G�Gc��tjt|��d��}tj�d��t
|d��5}|�tj�d����|�tj�d����ddd��n#1swxYwYt|d��5}|�
d��ddd��n#1swxYwYt
|d��5}tjt��5|���ddd��n#1swxYwYddd��dS#1swxYwYdS)	Nrrr<rorzw+bs��r)rrrar(rcrqrrBrrrDr�r�r�r
r�r�s   r1�test_fortran_bogus_sizer��s)���y��V���i�0�0�H��I�N�N�1����	�X�s�	#�	#�+�q�	���r�y���q�)�)�*�*�*�	���r�y���q�)�)�*�*�*�+�+�+�+�+�+�+�+�+�+�+����+�+�+�+�
�h��	�	��!�	�������������������������	�X�s�	#�	#��q�
�]�1�
2�
2�	�	�
�L�L�N�N�N�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	���������������������s[�A%C�C�
C�D�D�D�E.�5E�
E.�E	�E.�E	�E.�.E2�5E2c�n�tjt|��d��}tj�d��t
|d��5}|�tj�d����|�tj�d����ddd��n#1swxYwYt|d��5}|�
tj|��dz
��ddd��n#1swxYwYt
|d��5}t|�
����dksJ�tjt ��5|�
��ddd��n#1swxYwYddd��dS#1swxYwYdS)	Nrrr<rorr��r)rrrar(rcrqrrBrrrD�truncate�getsizerer�r�r�r
r�s   r1�test_fortran_eof_broken_recordr��sY���y��V���i�0�0�H��I�N�N�1����	�X�s�	#�	#�+�q�	���r�y���q�)�)�*�*�*�	���r�y���q�)�)�*�*�*�+�+�+�+�+�+�+�+�+�+�+����+�+�+�+�
�h��	�	�.��	�
�
�4�<��)�)�"�,�-�-�-�.�.�.�.�.�.�.�.�.�.�.����.�.�.�.�	�X�s�	#�	#��q��1�<�<�>�>�"�"�a�'�'�'�'�
�]�1�
2�
2�	�	�
�L�L�N�N�N�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	���������������������s\�A%C�C�
C�+D�D�D�0AF*�1F�F*�F	�F*�F	�F*�*F.�1F.c���tjt|��d��}d\}}}tjdtj||ffg��}tj||���}t|d��5}|�|d��|�|��|�|��ddd��n#1swxYwYt|d��5}|�
tj|��dz
��ddd��n#1swxYwYt|d	��5}t|�
|�����d
ksJ�t|�
|�����|ksJ�tjt ��5|�
|���ddd��n#1swxYwYddd��dS#1swxYwYdS)Nr)rro��fieldrr<rr�r�rr)rrrar(r�float64�zerosrrBrDr�r�rer%r�r�r
)rHr,rwr-�q�dtrir/s        r1�!test_fortran_eof_multidimensionalr��s����y��V���i�0�0�H��G�A�q�!�	��G�R�Z�!�Q��0�1�	2�	2�B�
���"����A�	�X�s�	#�	#��q�	���q��t����	���q����	���q����������������������
�h��	�	�.��	�
�
�4�<��)�)�"�,�-�-�-�.�.�.�.�.�.�.�.�.�.�.����.�.�.�.�	�X�s�	#�	#�$�q��1�=�=�r�=�*�*�+�+�q�0�0�0�0��1�=�=�r�=�*�*�+�+�q�0�0�0�0�
�]�1�
2�
2�	$�	$�
�M�M��M�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�$�$�$�$�$�$�$�$�$�$�$�$����$�$�$�$�$�$s\�3AC�C	�C	� +D�D�D�2A,G�G�5G�G	�G�G	�	G�G� G)"�__doc__r?rF�osr�globrr�
numpy.testingrr�numpyr(r��scipy.iorrr	r
r�dirname�__file__rr2r:rLrVrmr}r�r�r�r�r��r3r1�<module>r�s���*�*�����
�
�
�
�������������	�	�	�	�7�7�7�7�7�7�7�7�����
�
�
�
�.�.�.�.�.�.�.�.�.�.�.�.�
�D�I�l�d�l�8�,�,�f�5�5�	�%�%�%�$1�1�1�"�"�"�4"�"�"�.!�!�!�.(�(�(�V
�
�
����
�
�
����$�$�$�$�$r3

Youez - 2016 - github.com/yon3zu
LinuXploit