%PDF- %PDF-
Mini Shell

Mini Shell

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

a

z[yc�=�
@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@sZeZdZejddd�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�ZscopeZautousecCst�d�dS�N�unicode��poly�set_default_printstyle��self�r�J/usr/lib64/python3.9/site-packages/numpy/polynomial/tests/test_printing.py�use_unicode
sz)TestStrUnicodeSuperSubscripts.use_unicode��inp�tgt�����1.0 + 2.0·x¹ + 3.0·x²����rrru%-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¹¹cCstt�|��}t||�dS�N��strr�
Polynomialr�rrr�resrrr�test_polynomial_strsz1TestStrUnicodeSuperSubscripts.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)cCstt�|��}t||�dSr!�r#r�	Chebyshevrr%rrr�test_chebyshev_strsz0TestStrUnicodeSuperSubscripts.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)cCstt�|��}t||�dSr!�r#r�Legendrerr%rrr�test_legendre_str'sz/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)cCstt�|��}t||�dSr!�r#r�Hermiterr%rrr�test_hermite_str2sz.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)cCstt�|��}t||�dSr!�r#r�HermiteErr%rrr�test_hermiteE_str=s	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)cCstt�|��}t||�dSr!�r#r�Laguerrerr%rrr�test_laguerre_strIsz/TestStrUnicodeSuperSubscripts.test_laguerre_strN)�__name__�
__module__�__qualname__�pytest�fixturer�mark�parametrizerr'r+r.r1r4r7rrrrr	sL



�



�



�



�



�



�r	c@sZeZdZejddd�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))�TestStrAsciir
TrcCst�d�dS�N�asciirrrrr�	use_asciiWszTestStrAscii.use_asciirr�1.0 + 2.0 x**1 + 3.0 x**2rz%-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**11cCstt�|��}t||�dSr!r"r%rrrr'[sz 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)cCstt�|��}t||�dSr!r)r%rrrr+fs	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)cCstt�|��}t||�dSr!r,r%rrrr.rs	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)cCstt�|��}t||�dSr!r/r%rrrr1~s	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)cCstt�|��}t||�dSr!r2r%rrrr4�s	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)cCstt�|��}t||�dSr!r5r%rrrr7�s	zTestStrAscii.test_laguerre_strN)r8r9r:r;r<rBr=r>rr'r+r.r1r4r7rrrrr?UsL



�



�



�



�



�



�r?c@sXeZdZejddd�dd��Zdd�Zdd	�Zd
d�Zdd
�Z	ej
�dd�dd��ZdS)�TestLinebreakingr
TrcCst�d�dSr@rrrrrrB�szTestLinebreaking.use_asciicCs2t�gd��}ttt|��d�tt|�d�dS)N)��[rFrF��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�s
�z*TestLinebreaking.test_single_line_one_lesscCs2t�gd��}ttt|��d�tt|�d�dS)N)rFrFrFrG�
�KzK123456789.0 + 123456789.0 x**1 + 123456789.0 x**2 + 1234.0 x**3 +
10.0 x**4rIrKrrr�test_num_chars_is_linewidth�s
�z,TestLinebreaking.test_num_chars_is_linewidthcCs<t�gd��}ttt|��d�d�d�tt|�d�dS)N)rFrFrFr rrF�
rrHz[123456789.0 + 123456789.0 x**1 + 123456789.0 x**2 + 12.0 x**3 + 1.0 x**4 +
123456789.0 x**5)rr$rrJr#�splitrKrrr�6test_first_linebreak_multiline_one_less_than_linewidth�s��zGTestLinebreaking.test_first_linebreak_multiline_one_less_than_linewidthcCs t�gd��}tt|�d�dS)N)rFrFrF�{rrFz\123456789.0 + 123456789.0 x**1 + 123456789.0 x**2 + 123.0 x**3 +
1.0 x**4 + 123456789.0 x**5)rr$rr#rKrrr�+test_first_linebreak_multiline_on_linewidth�s��z<TestLinebreaking.test_first_linebreak_multiline_on_linewidth)�lwr))rOz�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**9cCsnt�gd��}t|d��Btt|�|�t|��d�D]}tt|�|k�q6Wd�n1s`0YdS)N)
rrN��i�i@�i �i�'	ipi@i�)Z	linewidthrQ)rr$rrr#rRrrJ)rrVrrL�linerrr�test_linewidth_printoption�s�z+TestLinebreaking.test_linewidth_printoptionN)
r8r9r:r;r<rBrMrPrSrUr=r>r[rrrrrE�s
		
rEcCs�t�gd��}t�gd��}t�d�tt|�d�tt|�d�t�d�tt|�d�tt|�d�t�t��t�d�Wd�n1s�0YdS)	NrrArCrDr
rr(Z
invalid_input)	rr$r*rrr#r;�raises�
ValueError)rL�crrr�test_set_default_printoptions�s

r_cCstgd�}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@�Zdtyper
u,1j + (1+1j)·x¹ - (2-2j)·x² + (3+0j)·x³u-1j + (1+1j)·x¹ + (-2+2j)·x² + (3+0j)·x³rAz,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#)�coefsZp1Zp2rrr�test_complex_coefficients�s


rc)rbrrrr�r`u1/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#�rbrrLrrr� test_numeric_object_coefficientss

ri)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.
    r
Nrgrhrrr�#test_nonnumeric_object_coefficientss

rkc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
TestFormatcCs,t�d�t�gd��}tt|d�d�dS)NrA�rrrrr
u$1.0 + 2.0·x¹ + 0.0·x² - 1.0·x³�rrr$r�formatrKrrr�test_format_unicode s
zTestFormat.test_format_unicodecCs,t�d�t�gd��}tt|d�d�dS)Nr
rmrAz$1.0 + 2.0 x**1 + 0.0 x**2 - 1.0 x**3rnrKrrr�test_format_ascii%s


�zTestFormat.test_format_asciicCs6t�d�t�gd��}tt|�d�t|�d�dS)NrArrCrnrKrrr�test_empty_formatstr,s
zTestFormat.test_empty_formatstrcCsFt�gd��}t�t��t|d�Wd�n1s80YdS)Nrmz.2f)rr$r;r\r]rorKrrr�test_bad_formatstr2szTestFormat.test_bad_formatstrN)r8r9r:rprqrrrsrrrrrlsrlc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestReprcCs$tt�ddg��}d}t||�dS)Nrrz6Polynomial([0., 1.], domain=[-1,  1], window=[-1,  1]))�reprrr$r�rr&rrrrr'9szTestRepr.test_polynomial_strcCs$tt�ddg��}d}t||�dS)Nrrz5Chebyshev([0., 1.], domain=[-1,  1], window=[-1,  1]))rurr*rrvrrrr+>szTestRepr.test_chebyshev_strcCs$tt�ddg��}d}t||�dS)Nrrz4Legendre([0., 1.], domain=[-1,  1], window=[-1,  1]))rurr-rrvrrr�test_legendre_reprCszTestRepr.test_legendre_reprcCs$tt�ddg��}d}t||�dS)Nrrz3Hermite([0., 1.], domain=[-1,  1], window=[-1,  1]))rurr0rrvrrr�test_hermite_reprHszTestRepr.test_hermite_reprcCs$tt�ddg��}d}t||�dS)Nrrz4HermiteE([0., 1.], domain=[-1,  1], window=[-1,  1]))rurr3rrvrrr�test_hermiteE_reprMszTestRepr.test_hermiteE_reprcCs$tt�ddg��}d}t||�dS)Nrrz0Laguerre([0., 1.], domain=[0, 1], window=[0, 1]))rurr6rrvrrr�test_laguerre_reprRszTestRepr.test_laguerre_reprN)	r8r9r:r'r+rwrxryrzrrrrrt8srtc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
TestLatexReprz#Test the latex repr used by JupytercCs$dd�|_z|��W|`S|`0dS)NcSst|�Sr!)r#)�xrrr�<lambda>_�z(TestLatexRepr.as_latex.<locals>.<lambda>)Z_repr_latex_scalarZ_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}$rzQ$x \mapsto 1.0 + 2.0\,\left(1.0 + 2.0x\right) + 3.0\,\left(1.0 + 2.0x\right)^{2}$)rr$rr�rKrrr�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)$rrr�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)$)rr*rr�rKrrr�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)$)rr3rr�rKrrr�test_multichar_basis_func�s
�z'TestLatexRepr.test_multichar_basis_funcN)r8r9r:�__doc__r�r�r�r�rrrrr{Xs

	r{)r;Z
numpy.corerrrZnumpy.polynomialZ
polynomialrZ
numpy.testingrrZ	fractionsr�decimalrr	r?rEr_rcr=r>rarirkrlrtr{rrrr�<module>s<JNB
����
�
	 

Zerion Mini Shell 1.0