o
    Ô­j-P  ã                
   @   sÊ  d dl mZmZ d dlZd dlmZmZmZ d dlm	Z
 d dlmZmZ d dlmZ d dlmZ G dd„ dƒZG d	d
„ d
ƒZG dd„ dƒZdd„ Zdd„ Zej deeddƒeddƒged�dfeddeddƒged�dfeedƒedƒdged�dff¡dd„ ƒZej deg d ¢ed�d!feddddgged�d"ff¡d#d$„ ƒZG d%d&„ d&ƒZej d'e
jd(fe
jd)fe
jd*fe
j d+fe
j!d,fe
j"d-ff¡d.d/„ ƒZ#G d0d1„ d1ƒZ$G d2d3„ d3ƒZ%d4Z&G d5d6„ d6ƒZ'dS )7é    )ÚnanÚinfN)ÚarrayÚarangeÚprintoptions)Úassert_equalÚassert_)ÚFraction)ÚDecimalc                   @   óZ  e Zd Zejddd�dd„ ƒZej dg d¢dfg d	¢d
fedƒdff¡dd„ ƒZ	ej dg d¢dfg d	¢dfedƒdff¡dd„ ƒZ
ej dg d¢dfg d	¢dfedƒdff¡dd„ ƒZej dg d¢dfg d	¢dfedƒdff¡dd„ ƒZej dg d¢dfg d	¢dfedƒd ff¡d!d"„ ƒZej dg d¢d#fg d	¢d$fedƒd%ff¡d&d'„ ƒZd(S ))ÚTestStrUnicodeSuperSubscriptsÚclassT©ÚscopeÚautousec                 C   ó   t  d¡ d S ©NÚunicode©ÚpolyÚset_default_printstyle©Úself© r   úa/var/www/html/CropPilot/venv/lib/python3.10/site-packages/numpy/polynomial/tests/test_printing.pyÚuse_unicode   ó   z)TestStrUnicodeSuperSubscripts.use_unicode©ÚinpÚtgt©é   é   é   õ   1.0 + 2.0Â·x + 3.0Â·xÂ²©éÿÿÿÿr   r#   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Â¹Â¹c                 C   ó   t t |¡ƒ}t||ƒ d S ©N©Ústrr   Ú
Polynomialr   ©r   r   r   Úresr   r   r   Ú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)c                 C   r(   r)   ©r+   r   Ú	Chebyshevr   r-   r   r   r   Útest_chebyshev_str   r0   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)c                 C   r(   r)   ©r+   r   ÚLegendrer   r-   r   r   r   Útest_legendre_str(   r0   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)c                 C   r(   r)   ©r+   r   ÚHermiter   r-   r   r   r   Útest_hermite_str3   r0   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)c                 C   r(   r)   ©r+   r   ÚHermiteEr   r-   r   r   r   Ú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)c                 C   r(   r)   ©r+   r   ÚLaguerrer   r-   r   r   r   Útest_laguerre_strJ   r0   z/TestStrUnicodeSuperSubscripts.test_laguerre_strN)Ú__name__Ú
__module__Ú__qualname__ÚpytestÚfixturer   ÚmarkÚparametrizer   r/   r4   r7   r:   r=   rA   r   r   r   r   r      sN    



ý



ý



ý



ý



ý



ýr   c                   @   r   ))ÚTestStrAsciir   Tr   c                 C   r   ©NÚasciir   r   r   r   r   Ú	use_asciiX   r   zTestStrAscii.use_asciir   r    ú1.0 + 2.0 x + 3.0 x**2r%   z"-1.0 + 0.0 x + 3.0 x**2 - 1.0 x**3r'   z}0.0 + 1.0 x + 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**11c                 C   r(   r)   r*   r-   r   r   r   r/   \   r0   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)c                 C   r(   r)   r2   r-   r   r   r   r4   g   r>   zTestStrAscii.test_chebyshev_strz1.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)c                 C   r(   r)   r5   r-   r   r   r   r7   s   r>   zTestStrAscii.test_legendre_strz1.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)c                 C   r(   r)   r8   r-   r   r   r   r:      r>   zTestStrAscii.test_hermite_strz1.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)c                 C   r(   r)   r;   r-   r   r   r   r=   ‹   r>   zTestStrAscii.test_hermiteE_strz1.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)c                 C   r(   r)   r?   r-   r   r   r   rA   —   r>   zTestStrAscii.test_laguerre_strN)rB   rC   rD   rE   rF   rL   rG   rH   r   r/   r4   r7   r:   r=   rA   r   r   r   r   rI   V   sN    



ý



ý



ý



ý



ý



ýrI   c                   @   sX   e Zd Zejddd�dd„ ƒZdd„ Zdd	„ Zd
d„ Zdd„ Z	ej
 dd¡dd„ ƒZdS )ÚTestLinebreakingr   Tr   c                 C   r   rJ   r   r   r   r   r   rL   ¦   r   zTestLinebreaking.use_asciic                 C   ó2   t  g d¢¡}ttt|ƒƒdƒ tt|ƒdƒ d S )N)éNa¼ rQ   rQ   rQ   é{   éJ   zJ12345678.0 + 12345678.0 x + 12345678.0 x**2 + 12345678.0 x**3 + 123.0 x**4©r   r,   r   Úlenr+   ©r   Úpr   r   r   Útest_single_line_one_lessª   ó
   ÿz*TestLinebreaking.test_single_line_one_lessc                 C   rP   )N)rQ   rQ   rQ   rQ   iÒ  éK   zK12345678.0 + 12345678.0 x + 12345678.0 x**2 + 12345678.0 x**3 +
1234.0 x**4rT   rV   r   r   r   Útest_num_chars_is_linewidth³   rY   z,TestLinebreaking.test_num_chars_is_linewidthc                 C   s<   t  g d¢¡}ttt|ƒ d¡d ƒdƒ tt|ƒdƒ d S )N)rQ   rQ   rQ   rQ   r!   rQ   Ú
r   rS   zZ12345678.0 + 12345678.0 x + 12345678.0 x**2 + 12345678.0 x**3 + 1.0 x**4 +
12345678.0 x**5)r   r,   r   rU   r+   ÚsplitrV   r   r   r   Ú6test_first_linebreak_multiline_one_less_than_linewidth¼   s   ÿÿzGTestLinebreaking.test_first_linebreak_multiline_one_less_than_linewidthc                 C   s    t  g d¢¡}tt|ƒdƒ d S )N)rQ   rQ   rQ   g=
×Ã)ŒgAr!   rQ   z[12345678.0 + 12345678.0 x + 12345678.0 x**2 + 12345678.12 x**3 +
1.0 x**4 + 12345678.0 x**5)r   r,   r   r+   rV   r   r   r   Ú+test_first_linebreak_multiline_on_linewidthÇ   s   ÿÿz<TestLinebreaking.test_first_linebreak_multiline_on_linewidth)Úlwr   ))rZ   z€0.0 + 10.0 x + 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 + 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 + 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**9c                 C   sp   t  g d¢¡}t|d��" tt|ƒ|ƒ t|ƒ d¡D ]
}tt|ƒ|k ƒ qW d   ƒ d S 1 s1w   Y  d S )N)
r   é
   éÈ   i¸  i@œ  i ¡ iÀ'	 ip i@  i„  )Ú	linewidthr\   )r   r,   r   r   r+   r]   r   rU   )r   r`   r   rW   Úliner   r   r   Útest_linewidth_printoptionÑ   s   ÿÿ"þz+TestLinebreaking.test_linewidth_printoptionN)rB   rC   rD   rE   rF   rL   rX   r[   r^   r_   rG   rH   rg   r   r   r   r   rO   ¤   s    
		
rO   c                  C   s¢   t  g d¢¡} t  g d¢¡}t  d¡ tt| ƒdƒ tt|ƒdƒ t  d¡ tt| ƒdƒ tt|ƒdƒ t t¡� t  d¡ W d   ƒ d S 1 sJw   Y  d S )	Nr    rK   rM   rN   r   r$   r1   Úinvalid_input)	r   r,   r3   r   r   r+   rE   ÚraisesÚ
ValueError)rW   Úcr   r   r   Útest_set_default_printoptionsæ   s   

"ÿrl   c                  C   st   g d¢} t  | ¡}t  t| td�¡}t  d¡ tt|ƒdƒ tt|ƒdƒ t  d¡ tt|ƒdƒ tt|ƒdƒ d	S )
z%Test both numpy and built-in complex.)y              ð?y      ð?      ð?y       À       @y      @        ©Údtyper   u*   1j + (1+1j)Â·x - (2-2j)Â·xÂ² + (3+0j)Â·xÂ³u+   1j + (1+1j)Â·x + (-2+2j)Â·xÂ² + (3+0j)Â·xÂ³rK   z)1j + (1+1j) x - (2-2j) x**2 + (3+0j) x**3z*1j + (1+1j) x + (-2+2j) x**2 + (3+0j) x**3N)r   r,   r   Úobjectr   r   r+   )ÚcoefsÚp1Úp2r   r   r   Útest_complex_coefficientsó   s   


rs   )rp   r   r!   r"   r#   é   rm   u   1/2 + 3/4Â·xé   é   u   1 + 2Â·x + 5/7Â·xÂ²z1.00z2.2u   1.00 + 2.2Â·x + 3Â·xÂ²c                 C   s&   t  | ¡}t  d¡ tt|ƒ|ƒ d S r   ©r   r,   r   r   r+   ©rp   r   rW   r   r   r   Ú test_numeric_object_coefficients  s   

ry   )r!   r"   Úfu   1 + 2Â·x + fÂ·xÂ²u   1 + 2Â·x + [3, 4]Â·xÂ²c                 C   s&   t  | ¡}t  d¡ tt|ƒ|ƒ dS )zK
    Test coef fallback for object arrays of non-numeric coefficients.
    r   Nrw   rx   r   r   r   Ú#test_nonnumeric_object_coefficients  s   

r{   c                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
Ú
TestFormatc                 C   ó,   t  d¡ t  g d¢¡}tt|dƒdƒ d S )NrK   ©r!   r"   r   r&   r   u"   1.0 + 2.0Â·x + 0.0Â·xÂ² - 1.0Â·xÂ³©r   r   r,   r   ÚformatrV   r   r   r   Útest_format_unicode!  s   
zTestFormat.test_format_unicodec                 C   r}   )Nr   r~   rK   z!1.0 + 2.0 x + 0.0 x**2 - 1.0 x**3r   rV   r   r   r   Útest_format_ascii&  s
   

ÿzTestFormat.test_format_asciic                 C   s6   t  d¡ t  g d¢¡}tt|ƒdƒ t|› dƒ d S )NrK   r    rM   r   rV   r   r   r   Útest_empty_formatstr-  s   
zTestFormat.test_empty_formatstrc                 C   sH   t  g d¢¡}t t¡� t|dƒ W d   ƒ d S 1 sw   Y  d S )Nr~   z.2f)r   r,   rE   ri   rj   r€   rV   r   r   r   Útest_bad_formatstr3  s   "ÿzTestFormat.test_bad_formatstrN)rB   rC   rD   r�   r‚   rƒ   r„   r   r   r   r   r|      s
    r|   )r   r   u   1.0 + 2.0Â·z + 3.0Â·zÂ²u!   1.0 + 2.0Â·Tâ‚�(z) + 3.0Â·Tâ‚‚(z)u!   1.0 + 2.0Â·Hâ‚�(z) + 3.0Â·Hâ‚‚(z)u#   1.0 + 2.0Â·Heâ‚�(z) + 3.0Â·Heâ‚‚(z)u!   1.0 + 2.0Â·Lâ‚�(z) + 3.0Â·Lâ‚‚(z)u!   1.0 + 2.0Â·Pâ‚�(z) + 3.0Â·Pâ‚‚(z)c                 C   s"   | g d¢dd�}t |d›|ƒ d S )Nr    Úz©Úsymbolr   )r   )r   r   rW   r   r   r   Útest_symbol9  s   	rˆ   c                   @   s<   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ ZdS )ÚTestReprc                 C   ó$   t t ddg¡ƒ}d}t||ƒ d S )Nr   r!   zBPolynomial([0., 1.], domain=[-1,  1], window=[-1,  1], symbol='x'))Úreprr   r,   r   ©r   r.   r   r   r   r   r/   G  ó   ÿzTestRepr.test_polynomial_strc                 C   rŠ   )Nr   r!   zAChebyshev([0., 1.], domain=[-1,  1], window=[-1,  1], symbol='x'))r‹   r   r3   r   rŒ   r   r   r   r4   O  r�   zTestRepr.test_chebyshev_strc                 C   rŠ   )Nr   r!   z@Legendre([0., 1.], domain=[-1,  1], window=[-1,  1], symbol='x'))r‹   r   r6   r   rŒ   r   r   r   Útest_legendre_reprW  r�   zTestRepr.test_legendre_reprc                 C   rŠ   )Nr   r!   z?Hermite([0., 1.], domain=[-1,  1], window=[-1,  1], symbol='x'))r‹   r   r9   r   rŒ   r   r   r   Útest_hermite_repr_  r�   zTestRepr.test_hermite_reprc                 C   rŠ   )Nr   r!   z@HermiteE([0., 1.], domain=[-1,  1], window=[-1,  1], symbol='x'))r‹   r   r<   r   rŒ   r   r   r   Útest_hermiteE_reprg  r�   zTestRepr.test_hermiteE_reprc                 C   rŠ   )Nr   r!   z<Laguerre([0., 1.], domain=[0, 1], window=[0, 1], symbol='x'))r‹   r   r@   r   rŒ   r   r   r   Útest_laguerre_repro  r�   zTestRepr.test_laguerre_reprN)	rB   rC   rD   r/   r4   rŽ   r�   r�   r‘   r   r   r   r   r‰   F  s    r‰   c                   @   s8   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )ÚTestLatexReprz#Test the latex repr used by Jupyterc                 C   s"   ddd„|_ z| ¡ W |` S |` w )NFc                 S   s   t | ƒS r)   )r+   )ÚxÚparensr   r   r   Ú<lambda>  s    z(TestLatexRepr.as_latex.<locals>.<lambda>)F)Ú_repr_latex_scalarÚ_repr_latex_)r   Úobjr   r   r   Úas_latex{  s   zTestLatexRepr.as_latexc                 C   s”   t  g d¢¡}t|  |¡dƒ t jg d¢ddgd�}t|  |¡dƒ t jg d¢ddgd�}t|  |¡d	ƒ t jg d¢d
dgd�}t|  |¡dƒ d S )Nr    z%$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}$ç      à¿ç      à?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}$©r   r,   r   r™   rV   r   r   r   Útest_simple_polynomial…  s    
ÿ
ÿ
ÿ
ÿz$TestLatexRepr.test_simple_polynomialc                 C   sH   t  g d¢¡}t|  |¡dƒ t jg d¢ddgd�}t|  |¡dƒ d S )Nr    z?$x \mapsto 1.0\,{T}_{0}(x) + 2.0\,{T}_{1}(x) + 3.0\,{T}_{2}(x)$r&   r   r›   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)$)r   r3   r   r™   rV   r   r   r   Útest_basis_funcš  s   
ÿ
ÿzTestLatexRepr.test_basis_funcc                 C   s"   t  g d¢¡}t|  |¡dƒ d S )Nr    zB$x \mapsto 1.0\,{He}_{0}(x) + 2.0\,{He}_{1}(x) + 3.0\,{He}_{2}(x)$)r   r<   r   r™   rV   r   r   r   Útest_multichar_basis_func£  s   
ÿz'TestLatexRepr.test_multichar_basis_funcc                 C   sž   t jg d¢dd�}t|  |¡dƒ t jg d¢ddgdd�}t|  |¡dƒ t jg d¢d	d
gdd�}t|  |¡dƒ t jg d¢ddgdd�}t|  |¡dƒ d S )Nr    r…   r†   z%$z \mapsto 1.0 + 2.0\,z + 3.0\,z^{2}$rš   r   )rœ   r‡   zK$z \mapsto 1.0 + 2.0\,\left(1.0 + z\right) + 3.0\,\left(1.0 + z\right)^{2}$r�   rž   zE$z \mapsto 1.0 + 2.0\,\left(2.0z\right) + 3.0\,\left(2.0z\right)^{2}$r&   zQ$z \mapsto 1.0 + 2.0\,\left(1.0 + 2.0z\right) + 3.0\,\left(1.0 + 2.0z\right)^{2}$rŸ   rV   r   r   r   Útest_symbol_basic¨  s&   
ÿý	ý	ýzTestLatexRepr.test_symbol_basicN)	rB   rC   rD   Ú__doc__r™   r    r¡   r¢   r£   r   r   r   r   r’   x  s    
	r’   )z"1.0 + (1.0e-01) x + (1.0e-02) x**2z"1.2 + (1.2e-01) x + (1.2e-02) x**2z11.23 + 0.12 x + (1.23e-02) x**2 + (1.23e-03) x**3z51.235 + 0.123 x + (1.235e-02) x**2 + (1.235e-03) x**3zG1.2346 + 0.1235 x + 0.0123 x**2 + (1.2346e-03) x**3 + (1.2346e-04) x**4zL1.23457 + 0.12346 x + 0.01235 x**2 + (1.23457e-03) x**3 + (1.23457e-04) x**4za1.234568 + 0.123457 x + 0.012346 x**2 + 0.001235 x**3 + (1.234568e-04) x**4 + (1.234568e-05) x**5zg1.2345679 + 0.1234568 x + 0.0123457 x**2 + 0.0012346 x**3 + (1.2345679e-04) x**4 + (1.2345679e-05) x**5c                   @   sN   e Zd ZdZejddd�dd„ ƒZdd„ Zd	d
„ Zdd„ Z	dd„ Z
dd„ ZdS )ÚTestPrintOptionsz©
    Test the output is properly configured via printoptions.
    The exponential notation is enabled automatically when the values 
    are too small or too large.
    r   Tr   c                 C   r   rJ   r   r   r   r   r   rL   á  r   zTestPrintOptions.use_asciic                 C   sZ   t  g d¢¡}tt|ƒdƒ tdd�� tt|ƒdƒ W d   ƒ d S 1 s&w   Y  d S )N©rž   g’$I’$IÂ?gI’$Ir?kAgmÛ¶m§¡AzC0.5 + 0.14285714 x + 14285714.28571429 x**2 + (1.42857143e+08) x**3r#   ©Ú	precisionz40.5 + 0.143 x + 14285714.286 x**2 + (1.429e+08) x**3©r   r,   r   r+   r   rV   r   r   r   Útest_strå  s
   "ÿzTestPrintOptions.test_strc                 C   sZ   t  g d¢¡}t| ¡ dƒ tdd�� t| ¡ dƒ W d   ƒ d S 1 s&w   Y  d S )Nr¦   zp$x \mapsto \text{0.5} + \text{0.14285714}\,x + \text{14285714.28571429}\,x^{2} + \text{(1.42857143e+08)}\,x^{3}$r#   r§   za$x \mapsto \text{0.5} + \text{0.143}\,x + \text{14285714.286}\,x^{2} + \text{(1.429e+08)}\,x^{3}$)r   r,   r   r—   r   rV   r   r   r   Ú
test_latexî  s   ÿÿ"ÿzTestPrintOptions.test_latexc                 C   s’   t  dg¡}tt|ƒdƒ tdd�� tt|ƒdƒ W d   ƒ n1 s$w   Y  tddd�� tt|ƒdƒ W d   ƒ d S 1 sBw   Y  d S )	Nrž   z0.5Úfixed)Ú	floatmodez
0.50000000rt   )r­   r¨   z0.5000r©   rV   r   r   r   Ú
test_fixedú  s   ÿ"ÿzTestPrintOptions.test_fixedc              	   C   sx   t tƒD ]5\}}t|d��$ t dd„ t|d d ƒD ƒ¡}t|ƒ dd¡|ks*J ‚W d   ƒ n1 s4w   Y  qd S )Nr§   c                 S   s   g | ]	}d d|   ‘qS )gÞƒBÊÀó?rc   r   )Ú.0Úir   r   r   Ú
<listcomp>  s    ÿz7TestPrintOptions.test_switch_to_exp.<locals>.<listcomp>r"   r#   r\   ú )Ú	enumerateÚSWITCH_TO_EXPr   r   r,   Úranger+   Úreplace)r   r°   ÚsrW   r   r   r   Útest_switch_to_exp  s   
ÿý€ÿz#TestPrintOptions.test_switch_to_expc                 C   s€   t  ttg¡}t|ƒdksJ ‚| ¡ dksJ ‚tddd�� t|ƒdks&J ‚| ¡ dks.J ‚W d   ƒ d S 1 s9w   Y  d S )Nznan + inf xz&$x \mapsto \text{nan} + \text{inf}\,x$ÚNANÚINF)ÚnanstrÚinfstrzNAN + INF xz&$x \mapsto \text{NAN} + \text{INF}\,x$)r   r,   r   r   r+   r—   r   rV   r   r   r   Útest_non_finite  s   
ÿ"þz TestPrintOptions.test_non_finiteN)rB   rC   rD   r¤   rE   rF   rL   rª   r«   r®   r¸   r½   r   r   r   r   r¥   Ú  s    
	
r¥   )(Úmathr   r   rE   Ú
numpy.corer   r   r   Únumpy.polynomialÚ
polynomialr   Únumpy.testingr   r   Ú	fractionsr	   Údecimalr
   r   rI   rO   rl   rs   rG   rH   ro   ry   r{   r|   r,   r3   r9   r<   r@   r6   rˆ   r‰   r’   r´   r¥   r   r   r   r   Ú<module>   sV    JNBÿÿÿù
þ
	ú
2U