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/polynomial/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

6��a�=�
@sbddlZddlmZmZmZddlmZddlm	Z	m
Z
ddlmZddl
mZGdd�d�ZGdd	�d	�ZGd
d�d�Zdd
�Zdd�Zej�deedd�edd�ged�dfeddedd�ged�dfeed�ed�dged�dff�dd��Zej�degd�ed�d feddddgged�d!ff�d"d#��ZGd$d%�d%�ZGd&d'�d'�ZGd(d)�d)�ZdS)*�N)�array�arange�printoptions)�assert_equal�assert_)�Fraction)�Decimalc@�ZeZdZejddd�dd��Zej�dgd�dfgd	�d
fed�dff�d
d��Z	ej�dgd�dfgd	�dfed�dff�dd��Z
ej�dgd�dfgd	�dfed�dff�dd��Zej�dgd�dfgd	�dfed�dff�dd��Zej�dgd�dfgd	�dfed�d ff�d!d"��Z
ej�dgd�d#fgd	�d$fed�d%ff�d&d'��Zd(S))�TestStrUnicodeSuperSubscripts�classT��scope�autousecC�t�d�dS�N�unicode��poly�set_default_printstyle��self�r�F/usr/lib/python3/dist-packages/numpy/polynomial/tests/test_printing.py�use_unicode
�z)TestStrUnicodeSuperSubscripts.use_unicode��inp�tgt�����1.0 + 2.0·x¹ + 3.0·x²����rr!r$u%-1.0 + 0.0·x¹ + 3.0·x² - 1.0·x³�u�0.0 + 1.0·x¹ + 2.0·x² + 3.0·x³ + 4.0·x⁴ + 5.0·x⁵ + 6.0·x⁶ + 7.0·x⁷ +
8.0·x⁸ + 9.0·x⁹ + 10.0·x¹⁰ + 11.0·x¹¹cC�tt�|��}t||�dS�N��strr�
Polynomialr�rrr�resrrr�test_polynomial_str�z1TestStrUnicodeSuperSubscripts.test_polynomial_str�!1.0 + 2.0·T₁(x) + 3.0·T₂(x)u1-1.0 + 0.0·T₁(x) + 3.0·T₂(x) - 1.0·T₃(x)u�0.0 + 1.0·T₁(x) + 2.0·T₂(x) + 3.0·T₃(x) + 4.0·T₄(x) + 5.0·T₅(x) +
6.0·T₆(x) + 7.0·T₇(x) + 8.0·T₈(x) + 9.0·T₉(x) + 10.0·T₁₀(x) + 11.0·T₁₁(x)cCr&r'�r)r�	Chebyshevrr+rrr�test_chebyshev_strr.z0TestStrUnicodeSuperSubscripts.test_chebyshev_stru!1.0 + 2.0·P₁(x) + 3.0·P₂(x)u1-1.0 + 0.0·P₁(x) + 3.0·P₂(x) - 1.0·P₃(x)u�0.0 + 1.0·P₁(x) + 2.0·P₂(x) + 3.0·P₃(x) + 4.0·P₄(x) + 5.0·P₅(x) +
6.0·P₆(x) + 7.0·P₇(x) + 8.0·P₈(x) + 9.0·P₉(x) + 10.0·P₁₀(x) + 11.0·P₁₁(x)cCr&r'�r)r�Legendrerr+rrr�test_legendre_str'r.z/TestStrUnicodeSuperSubscripts.test_legendre_stru!1.0 + 2.0·H₁(x) + 3.0·H₂(x)u1-1.0 + 0.0·H₁(x) + 3.0·H₂(x) - 1.0·H₃(x)u�0.0 + 1.0·H₁(x) + 2.0·H₂(x) + 3.0·H₃(x) + 4.0·H₄(x) + 5.0·H₅(x) +
6.0·H₆(x) + 7.0·H₇(x) + 8.0·H₈(x) + 9.0·H₉(x) + 10.0·H₁₀(x) + 11.0·H₁₁(x)cCr&r'�r)r�Hermiterr+rrr�test_hermite_str2r.z.TestStrUnicodeSuperSubscripts.test_hermite_stru#1.0 + 2.0·He₁(x) + 3.0·He₂(x)u4-1.0 + 0.0·He₁(x) + 3.0·He₂(x) - 1.0·He₃(x)u�0.0 + 1.0·He₁(x) + 2.0·He₂(x) + 3.0·He₃(x) + 4.0·He₄(x) + 5.0·He₅(x) +
6.0·He₆(x) + 7.0·He₇(x) + 8.0·He₈(x) + 9.0·He₉(x) + 10.0·He₁₀(x) +
11.0·He₁₁(x)cCr&r'�r)r�HermiteErr+rrr�test_hermiteE_str=�	z/TestStrUnicodeSuperSubscripts.test_hermiteE_stru!1.0 + 2.0·L₁(x) + 3.0·L₂(x)u1-1.0 + 0.0·L₁(x) + 3.0·L₂(x) - 1.0·L₃(x)u�0.0 + 1.0·L₁(x) + 2.0·L₂(x) + 3.0·L₃(x) + 4.0·L₄(x) + 5.0·L₅(x) +
6.0·L₆(x) + 7.0·L₇(x) + 8.0·L₈(x) + 9.0·L₉(x) + 10.0·L₁₀(x) + 11.0·L₁₁(x)cCr&r'�r)r�Laguerrerr+rrr�test_laguerre_strIr.z/TestStrUnicodeSuperSubscripts.test_laguerre_strN)�__name__�
__module__�__qualname__�pytest�fixturer�mark�parametrizerr-r2r5r8r;r?rrrrr
sN



�



�



�



�



�



�r
c@r	))�TestStrAsciirTrcCr�N�asciirrrrr�	use_asciiWrzTestStrAscii.use_asciirr�1.0 + 2.0 x**1 + 3.0 x**2r#z%-1.0 + 0.0 x**1 + 3.0 x**2 - 1.0 x**3r%z�0.0 + 1.0 x**1 + 2.0 x**2 + 3.0 x**3 + 4.0 x**4 + 5.0 x**5 + 6.0 x**6 +
7.0 x**7 + 8.0 x**8 + 9.0 x**9 + 10.0 x**10 + 11.0 x**11cCr&r'r(r+rrrr-[r.z TestStrAscii.test_polynomial_str�1.0 + 2.0 T_1(x) + 3.0 T_2(x)z+-1.0 + 0.0 T_1(x) + 3.0 T_2(x) - 1.0 T_3(x)z�0.0 + 1.0 T_1(x) + 2.0 T_2(x) + 3.0 T_3(x) + 4.0 T_4(x) + 5.0 T_5(x) +
6.0 T_6(x) + 7.0 T_7(x) + 8.0 T_8(x) + 9.0 T_9(x) + 10.0 T_10(x) +
11.0 T_11(x)cCr&r'r0r+rrrr2fr<zTestStrAscii.test_chebyshev_strz1.0 + 2.0 P_1(x) + 3.0 P_2(x)z+-1.0 + 0.0 P_1(x) + 3.0 P_2(x) - 1.0 P_3(x)z�0.0 + 1.0 P_1(x) + 2.0 P_2(x) + 3.0 P_3(x) + 4.0 P_4(x) + 5.0 P_5(x) +
6.0 P_6(x) + 7.0 P_7(x) + 8.0 P_8(x) + 9.0 P_9(x) + 10.0 P_10(x) +
11.0 P_11(x)cCr&r'r3r+rrrr5rr<zTestStrAscii.test_legendre_strz1.0 + 2.0 H_1(x) + 3.0 H_2(x)z+-1.0 + 0.0 H_1(x) + 3.0 H_2(x) - 1.0 H_3(x)z�0.0 + 1.0 H_1(x) + 2.0 H_2(x) + 3.0 H_3(x) + 4.0 H_4(x) + 5.0 H_5(x) +
6.0 H_6(x) + 7.0 H_7(x) + 8.0 H_8(x) + 9.0 H_9(x) + 10.0 H_10(x) +
11.0 H_11(x)cCr&r'r6r+rrrr8~r<zTestStrAscii.test_hermite_strz1.0 + 2.0 He_1(x) + 3.0 He_2(x)z.-1.0 + 0.0 He_1(x) + 3.0 He_2(x) - 1.0 He_3(x)z�0.0 + 1.0 He_1(x) + 2.0 He_2(x) + 3.0 He_3(x) + 4.0 He_4(x) +
5.0 He_5(x) + 6.0 He_6(x) + 7.0 He_7(x) + 8.0 He_8(x) + 9.0 He_9(x) +
10.0 He_10(x) + 11.0 He_11(x)cCr&r'r9r+rrrr;�r<zTestStrAscii.test_hermiteE_strz1.0 + 2.0 L_1(x) + 3.0 L_2(x)z+-1.0 + 0.0 L_1(x) + 3.0 L_2(x) - 1.0 L_3(x)z�0.0 + 1.0 L_1(x) + 2.0 L_2(x) + 3.0 L_3(x) + 4.0 L_4(x) + 5.0 L_5(x) +
6.0 L_6(x) + 7.0 L_7(x) + 8.0 L_8(x) + 9.0 L_9(x) + 10.0 L_10(x) +
11.0 L_11(x)cCr&r'r=r+rrrr?�r<zTestStrAscii.test_laguerre_strN)r@rArBrCrDrJrErFrr-r2r5r8r;r?rrrrrGUsN



�



�



�



�



�



�rGc@sXeZdZejddd�dd��Zdd�Zdd	�Zd
d�Zdd
�Z	ej
�dd�dd��ZdS)�TestLinebreakingrTrcCrrHrrrrrrJ�rzTestLinebreaking.use_asciicC�2t�gd��}ttt|��d�tt|�d�dS)N)��[rOrO��r�JzJ123456789.0 + 123456789.0 x**1 + 123456789.0 x**2 + 1234.0 x**3 + 1.0 x**4�rr*r�lenr)�r�prrr�test_single_line_one_less��
�z*TestLinebreaking.test_single_line_one_lesscCrN)N)rOrOrOrP�
�KzK123456789.0 + 123456789.0 x**1 + 123456789.0 x**2 + 1234.0 x**3 +
10.0 x**4rRrTrrr�test_num_chars_is_linewidth�rWz,TestLinebreaking.test_num_chars_is_linewidthcCs<t�gd��}ttt|��d�d�d�tt|�d�dS)N)rOrOrOr%rrO�
rrQz[123456789.0 + 123456789.0 x**1 + 123456789.0 x**2 + 12.0 x**3 + 1.0 x**4 +
123456789.0 x**5)rr*rrSr)�splitrTrrr�6test_first_linebreak_multiline_one_less_than_linewidth�s��zGTestLinebreaking.test_first_linebreak_multiline_one_less_than_linewidthcCs t�gd��}tt|�d�dS)N)rOrOrO�{rrOz\123456789.0 + 123456789.0 x**1 + 123456789.0 x**2 + 123.0 x**3 +
1.0 x**4 + 123456789.0 x**5)rr*rr)rTrrr�+test_first_linebreak_multiline_on_linewidth�s��z<TestLinebreaking.test_first_linebreak_multiline_on_linewidth)�lwr))rYz�0.0 + 10.0 x**1 + 200.0 x**2 + 3000.0 x**3 + 40000.0 x**4 +
500000.0 x**5 + 600000.0 x**6 + 70000.0 x**7 + 8000.0 x**8 + 900.0 x**9)�-z�0.0 + 10.0 x**1 + 200.0 x**2 + 3000.0 x**3 +
40000.0 x**4 + 500000.0 x**5 +
600000.0 x**6 + 70000.0 x**7 + 8000.0 x**8 +
900.0 x**9)�z�0.0 + 10.0 x**1 + 200.0 x**2 + 3000.0 x**3 + 40000.0 x**4 + 500000.0 x**5 + 600000.0 x**6 + 70000.0 x**7 + 8000.0 x**8 + 900.0 x**9cCspt�gd��}t|d��"tt|�|�t|��d�D]
}tt|�|k�qWd�dS1s1wYdS)N)
rrX��i�i@�i �i�'	ipi@i�)�	linewidthr[)rr*rrr)r\rrS)rr`rrU�linerrr�test_linewidth_printoption�s��"�z+TestLinebreaking.test_linewidth_printoptionN)
r@rArBrCrDrJrVrZr]r_rErFrfrrrrrM�s
		
rMcCs�t�gd��}t�gd��}t�d�tt|�d�tt|�d�t�d�tt|�d�tt|�d�t�t��t�d�Wd�dS1sJwYdS)	NrrIrKrLrr"r/�
invalid_input)	rr*r1rrr)rC�raises�
ValueError)rU�crrr�test_set_default_printoptions�s

"�rkcCstgd�}t�|�}t�t|td��}t�d�tt|�d�tt|�d�t�d�tt|�d�tt|�d�d	S)
z%Test both numpy and built-in complex.)y�?y�?�?y�@y@��dtyperu,1j + (1+1j)·x¹ - (2-2j)·x² + (3+0j)·x³u-1j + (1+1j)·x¹ + (-2+2j)·x² + (3+0j)·x³rIz,1j + (1+1j) x**1 - (2-2j) x**2 + (3+0j) x**3z-1j + (1+1j) x**1 + (-2+2j) x**2 + (3+0j) x**3N)rr*r�objectrrr))�coefs�p1�p2rrr�test_complex_coefficients�s


rr)rorrr r!�rlu1/2 + 3/4·x¹��u1 + 2·x¹ + 5/7·x²z1.00z2.2u1.00 + 2.2·x¹ + 3·x²cCs&t�|�}t�d�tt|�|�dSr�rr*rrr)�rorrUrrr� test_numeric_object_coefficientss

rx)rr �fu1 + 2·x¹ + f·x²u1 + 2·x¹ + [3, 4]·x²cCs&t�|�}t�d�tt|�|�dS)zK
    Test coef fallback for object arrays of non-numeric coefficients.
    rNrvrwrrr�#test_nonnumeric_object_coefficientss

rzc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
TestFormatcC�,t�d�t�gd��}tt|d�d�dS)NrI�rr rr$ru$1.0 + 2.0·x¹ + 0.0·x² - 1.0·x³�rrr*r�formatrTrrr�test_format_unicode s
zTestFormat.test_format_unicodecCr|)Nrr}rIz$1.0 + 2.0 x**1 + 0.0 x**2 - 1.0 x**3r~rTrrr�test_format_ascii%s


�zTestFormat.test_format_asciicCs6t�d�t�gd��}tt|�d�t|�d�dS)NrIrrKr~rTrrr�test_empty_formatstr,s
zTestFormat.test_empty_formatstrcCsHt�gd��}t�t��t|d�Wd�dS1swYdS)Nr}z.2f)rr*rCrhrirrTrrr�test_bad_formatstr2s"�zTestFormat.test_bad_formatstrN)r@rArBr�r�r�r�rrrrr{s
r{c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestReprcC�$tt�ddg��}d}t||�dS)Nrrz6Polynomial([0., 1.], domain=[-1,  1], window=[-1,  1]))�reprrr*r�rr,rrrrr-9�zTestRepr.test_polynomial_strcCr�)Nrrz5Chebyshev([0., 1.], domain=[-1,  1], window=[-1,  1]))r�rr1rr�rrrr2>r�zTestRepr.test_chebyshev_strcCr�)Nrrz4Legendre([0., 1.], domain=[-1,  1], window=[-1,  1]))r�rr4rr�rrr�test_legendre_reprCr�zTestRepr.test_legendre_reprcCr�)Nrrz3Hermite([0., 1.], domain=[-1,  1], window=[-1,  1]))r�rr7rr�rrr�test_hermite_reprHr�zTestRepr.test_hermite_reprcCr�)Nrrz4HermiteE([0., 1.], domain=[-1,  1], window=[-1,  1]))r�rr:rr�rrr�test_hermiteE_reprMr�zTestRepr.test_hermiteE_reprcCr�)Nrrz0Laguerre([0., 1.], domain=[0, 1], window=[0, 1]))r�rr>rr�rrr�test_laguerre_reprRr�zTestRepr.test_laguerre_reprN)	r@rArBr-r2r�r�r�r�rrrrr�8sr�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
TestLatexReprz#Test the latex repr used by JupytercCs dd�|_z|��W|`S|`w)NcSst|�Sr')r))�xrrr�<lambda>_sz(TestLatexRepr.as_latex.<locals>.<lambda>)�_repr_latex_scalar�_repr_latex_)r�objrrr�as_latex[s
zTestLatexRepr.as_latexcCs�t�gd��}t|�|�d�tjgd�ddgd�}t|�|�d�tjgd�ddgd�}t|�|�d	�tjgd�d
dgd�}t|�|�d�dS)Nrz%$x \mapsto 1.0 + 2.0\,x + 3.0\,x^{2}$���r��domainzK$x \mapsto 1.0 + 2.0\,\left(1.0 + x\right) + 3.0\,\left(1.0 + x\right)^{2}$g�g�?zE$x \mapsto 1.0 + 2.0\,\left(2.0x\right) + 3.0\,\left(2.0x\right)^{2}$r$zQ$x \mapsto 1.0 + 2.0\,\left(1.0 + 2.0x\right) + 3.0\,\left(1.0 + 2.0x\right)^{2}$)rr*rr�rTrrr�test_simple_polynomiales 
�
�
�
�z$TestLatexRepr.test_simple_polynomialcCsHt�gd��}t|�|�d�tjgd�ddgd�}t|�|�d�dS)Nrz?$x \mapsto 1.0\,{T}_{0}(x) + 2.0\,{T}_{1}(x) + 3.0\,{T}_{2}(x)$r$rr�zZ$x \mapsto 1.0\,{T}_{0}(1.0 + 2.0x) + 2.0\,{T}_{1}(1.0 + 2.0x) + 3.0\,{T}_{2}(1.0 + 2.0x)$)rr1rr�rTrrr�test_basis_funczs
�
�zTestLatexRepr.test_basis_funccCs"t�gd��}t|�|�d�dS)NrzB$x \mapsto 1.0\,{He}_{0}(x) + 2.0\,{He}_{1}(x) + 3.0\,{He}_{2}(x)$)rr:rr�rTrrr�test_multichar_basis_func�s
�z'TestLatexRepr.test_multichar_basis_funcN)r@rArB�__doc__r�r�r�r�rrrrr�Xs
	r�)rC�
numpy.corerrr�numpy.polynomial�
polynomialr�
numpy.testingrr�	fractionsr�decimalrr
rGrMrkrrrErFrnrxrzr{r�r�rrrr�<module>s>JNB
����
�
	 

https://t.me/RX1948 - 2025