a
    <b0                     @   sl  d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ ddl%m&Z&m'Z' ddl(m)Z)m*Z* ddl+m,Z, ddl-m.Z. dd	l/m0Z0 dd
l1m2Z2m3Z3m4Z4 dd Z5dd Z6dd Z7dd Z8dd Z9dd Z:dd Z;dd Z<dd Z=dd Z>dd  Z?d!d" Z@d#d$ ZAd%d& ZBd'd( ZCd)d* ZDd+d, ZEd-d. ZFd/d0 ZGd1d2 ZHd3d4 ZId5d6 ZJd7d8 ZKd9d: ZLd;d< ZMd=d> ZNd?d@ ZOdAdB ZPdCdD ZQdEdF ZRdGdH ZSdIdJ ZTdKdL ZUdMdN ZVdOdP ZWdQdR ZXdSdT ZYdUdV ZZdWdX Z[dYdZ Z\d[d\ Z]d]d^ Z^d_d` Z_dadb Z`dcdd Zadedf ZbdgS )hzFTests for options manager for :class:`Poly` and public API functions.     )OptionsExpandGensWrtSortOrderFieldGreedyDomainSplitGaussian	ExtensionModulus	SymmetricStrictAutoFracFormalPolysIncludeAllGenSymbolsMethod)lex)FFGFZZQQQQ_IRRCCEX)OptionErrorGeneratorsError)IInteger)Symbol)sqrt)raisesxyzc                  C   s   t tttfddi} | jtttfks(J | jtks6J d| v du sFJ | ttfdd}| jtttfksnJ | jtks|J d| v du sJ |jttfksJ |jtksJ d|v du sJ d S )Ndomainr   orderFr   )gensr/   T)r   r+   r,   r-   r0   r.   r   clone)optZnew_opt r3   r/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/sympy/polys/tests/test_polyoptions.pytest_Options_clone   s    r5   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr      c                   S   s
   t tS N)r   
preprocessr+   r3   r3   r3   r4   <lambda>-       z(test_Expand_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Expand_preprocess&   s
    r;   c                  C   s&   ddi} t |  | ddiks"J d S )NexpandT)r   postprocessr2   r3   r3   r4   test_Expand_postprocess0   s    
r?   c                      s   t ddksJ t tttftttfks0J t tttfftttfksPJ tddd ttdd  tt fdd d S )	Nr7   r3   aF)Zcommutativec                   S   s   t tttfS r7   r   r8   r+   r,   r3   r3   r3   r4   r9   >   r:   z&test_Gens_preprocess.<locals>.<lambda>c                      s   t tt fS r7   rA   r3   r@   r3   r4   r9   ?   r:   )r   r8   r+   r,   r-   r'   r)   r$   r3   r3   rB   r4   test_Gens_preprocess7   s     rC   c                  C   s.   dt tfi} t|  | dt tfiks*J d S )Nr0   )r+   r,   r   r=   r>   r3   r3   r4   test_Gens_postprocessB   s    
rD   c                   C   s   t tdgksJ t dg ks&J t dg ks8J t dddgksNJ t dddgksdJ t dddgkszJ t dddgksJ t d	ddgksJ t d
ddgksJ t ttgddgksJ ttdd  ttdd  d S )Nr+     zx,yr,   zx yzx, yzx , yz x, yz x,  yc                   S   s
   t dS )N,r   r8   r3   r3   r3   r4   r9   U   r:   z%test_Wrt_preprocess.<locals>.<lambda>c                   S   s
   t dS Nr   rH   r3   r3   r3   r4   r9   V   r:   )r   r8   r+   r,   r)   r#   r3   r3   r3   r4   test_Wrt_preprocessI   s    rJ   c                  C   s*   ddgi} t |  | ddgiks&J d S )NZwrtr+   )r   r=   r>   r3   r3   r4   test_Wrt_postprocessY   s    

rK   c                   C   s   t tttgg dksJ t tttfg dks8J t dg dksNJ t dg dksdJ ttdd  ttdd  d S )Nr*   z	x > y > zzx>y>zc                   S   s
   t dS rI   )r   r8   r3   r3   r3   r4   r9   g   r:   z&test_Sort_preprocess.<locals>.<lambda>c                   S   s   t ttthS r7   )r   r8   r+   r,   r-   r3   r3   r3   r4   r9   h   r:   )r   r8   r+   r,   r-   r)   r#   r3   r3   r3   r4   test_Sort_preprocess`   s    rL   c                  C   s&   ddi} t |  | ddiks"J d S )Nsortzx > y)r   r=   r>   r3   r3   r4   test_Sort_postprocessk   s    
rN   c                   C   s   t dtksJ d S )Nr   )r   r8   r   r3   r3   r3   r4   test_Order_preprocessr   s    rO   c                  C   s&   ddi} t |  | ddiks"J d S )Nr/   T)r   r=   r>   r3   r3   r4   test_Order_postprocessv   s    
rP   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9      r:   z'test_Field_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Field_preprocess}   s
    rQ   c                  C   s&   ddi} t |  | ddiks"J d S )NfieldT)r   r=   r>   r3   r3   r4   test_Field_postprocess   s    
rS   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r	   r8   r+   r3   r3   r3   r4   r9      r:   z(test_Greedy_preprocess.<locals>.<lambda>)r	   r8   r)   r#   r3   r3   r3   r4   test_Greedy_preprocess   s
    rT   c                  C   s&   ddi} t |  | ddiks"J d S )NZgreedyT)r	   r=   r>   r3   r3   r4   test_Greedy_postprocess   s    
rU   c                   C   s  t ttksJ t ttks$J t ttks6J t tdtdksPJ t tttf tttf ksrJ t dtksJ t dtksJ t dtksJ t dtksJ t dtksJ t dtdksJ t d	tdksJ t	t
d
d  t dtt ksJ t dtt ks6J t dtt ksNJ t dtt ksfJ t dtt ks~J t dtt ksJ t dtt ksJ t dtt ksJ t dtttf ksJ t dtttf ksJ t dtttf ksJ t dtttf ks6J t dtttf ksRJ t dtttf ksnJ t dtttf ksJ t dtttf ksJ t	t
dd  t dttksJ t dttksJ t dttksJ t d ttksJ t d!tttks8J t d"tttksTJ t d#tttkspJ t d$tttksJ t d%ttksJ t d&ttksJ t d'ttdtksJ t d(ttdtks J t	t
d)d  d S )*N   ZQr   r   r"   zFF(23)   zGF(23)c                   S   s
   t dS )NzZ[]r
   r8   r3   r3   r3   r4   r9      r:   z(test_Domain_preprocess.<locals>.<lambda>zZ[x]zQ[x]zR[x]zC[x]zZZ[x]zQQ[x]zRR[x]zCC[x]zZ[x,y]zQ[x,y]zR[x,y]zC[x,y]zZZ[x,y]zQQ[x,y]zRR[x,y]zCC[x,y]c                   S   s
   t dS )NzZ()rZ   r3   r3   r3   r4   r9      r:   zZ(x)zQ(x)zZZ(x)zQQ(x)zZ(x,y)zQ(x,y)zZZ(x,y)zQQ(x,y)zQ<I>zQQ<I>zQ<sqrt(2), I>zQQ<sqrt(2), I>c                   S   s
   t dS )NabcrZ   r3   r3   r3   r4   r9      r:   )r
   r8   r   r   r"   r   r+   r,   r   r)   r#   r    r!   Z
frac_fieldalgebraic_fieldr%   r(   r3   r3   r3   r4   test_Domain_preprocess   s^    " 
r]   c                   C   s.   t tdd  t tdd  t tdd  d S )Nc                   S   s   t ttftttf dS )Nr0   r.   )r
   r=   r+   r,   r   r-   r3   r3   r3   r4   r9      s   

z)test_Domain_postprocess.<locals>.<lambda>c                   S   s   t dtdS )Nr3   r^   r
   r=   r"   r3   r3   r3   r4   r9      s   c                   S   s   t dtiS )Nr.   r_   r3   r3   r3   r4   r9      r:   )r)   r$   r3   r3   r3   r4   test_Domain_postprocess   s    r`   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9      r:   z'test_Split_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Split_preprocess   s
    ra   c                   C   s   t tdd  d S )Nc                   S   s   t ddiS )NsplitT)r   r=   r3   r3   r3   r4   r9      r:   z(test_Split_postprocess.<locals>.<lambda>)r)   NotImplementedErrorr3   r3   r3   r4   test_Split_postprocess   s    rd   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9      r:   z*test_Gaussian_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Gaussian_preprocess   s
    re   c                  C   s(   ddi} t |  | dtdks$J d S )NgaussianT)rf   r.   )r   r=   r   r>   r3   r3   r4   test_Gaussian_postprocess   s    
rg   c                   C   s   t ddu sJ t ddu s$J t g d u s6J t tdtdhksRJ t tdgtdhkspJ t tdtgtdthksJ ttdd  ttdd  d S )NTr6   rV   c                   S   s
   t dS )NFr   r8   r3   r3   r3   r4   r9     r:   z+test_Extension_preprocess.<locals>.<lambda>c                   S   s
   t dS rI   rh   r3   r3   r3   r4   r9     r:   )r   r8   r(   r%   r)   r#   r3   r3   r3   r4   test_Extension_preprocess
  s    "ri   c                  C   s`   dt dhi} t|  | t dhtt ddks:J ddi} t|  | ddiks\J d S )N	extensionrV   )rj   r.   T)r(   r   r=   r   r\   r>   r3   r3   r4   test_Extension_postprocess  s    

rk   c                   C   sH   t ddksJ t tddks(J ttdd  ttdd  d S )NrY   c                   S   s
   t dS rI   )r   r8   r3   r3   r3   r4   r9   ,  r:   z)test_Modulus_preprocess.<locals>.<lambda>c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9   -  r:   )r   r8   r&   r)   r#   r3   r3   r3   r4   test_Modulus_preprocess(  s    rl   c                  C   sZ   ddi} t |  | dtddks(J ddd} t |  | dtddddksVJ d S )Nmodulus   )rm   r.   F)rm   	symmetric)rm   r.   ro   )r   r=   r   r>   r3   r3   r4   test_Modulus_postprocess0  s    


rp   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9   J  r:   z+test_Symmetric_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Symmetric_preprocessC  s
    rq   c                  C   s&   ddi} t |  | ddiks"J d S )Nro   T)r   r=   r>   r3   r3   r4   test_Symmetric_postprocessM  s    
rr   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9   [  r:   z(test_Strict_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Strict_preprocessT  s
    rs   c                  C   s&   ddi} t |  | ddiks"J d S )NstrictT)r   r=   r>   r3   r3   r4   test_Strict_postprocess^  s    
ru   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9   l  r:   z&test_Auto_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Auto_preprocesse  s
    rv   c                  C   s&   ddi} t |  | ddiks"J d S )NautoT)r   r=   r>   r3   r3   r4   test_Auto_postprocesso  s    
rx   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9   }  r:   z&test_Frac_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Frac_preprocessv  s
    ry   c                  C   s&   ddi} t |  | ddiks"J d S )NfracT)r   r=   r>   r3   r3   r4   test_Frac_postprocess  s    
r{   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9     r:   z(test_Formal_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Formal_preprocess  s
    r|   c                  C   s&   ddi} t |  | ddiks"J d S )NZformalT)r   r=   r>   r3   r3   r4   test_Formal_postprocess  s    
r}   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9     r:   z'test_Polys_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Polys_preprocess  s
    r~   c                  C   s&   ddi} t |  | ddiks"J d S )NZpolysT)r   r=   r>   r3   r3   r4   test_Polys_postprocess  s    
r   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9     r:   z)test_Include_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_Include_preprocess  s
    r   c                  C   s&   ddi} t |  | ddiks"J d S )NincludeT)r   r=   r>   r3   r3   r4   test_Include_postprocess  s    
r   c                   C   sZ   t ddu sJ t ddu s$J t ddu s6J t ddu sHJ ttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9     r:   z%test_All_preprocess.<locals>.<lambda>)r   r8   r)   r#   r3   r3   r3   r4   test_All_preprocess  s
    r   c                  C   s&   ddi} t |  | ddiks"J d S )NallT)r   r=   r>   r3   r3   r4   test_All_postprocess  s    
r   c                  C   s&   dt i} t|  | dt iks"J d S )Ngen)r+   r   r=   r>   r3   r3   r4   test_Gen_postprocess  s    
r   c                   C   s   t tdd  d S )Nc                   S   s
   t tS r7   )r   r8   r+   r3   r3   r3   r4   r9     r:   z)test_Symbols_preprocess.<locals>.<lambda>r)   r#   r3   r3   r3   r4   test_Symbols_preprocess  s    r   c                  C   s2   dt ttgi} t|  | dt ttgiks.J d S )Nsymbols)r+   r,   r-   r   r=   r>   r3   r3   r4   test_Symbols_postprocess  s    
r   c                   C   s   t tdd  d S )Nc                   S   s
   t dS )N
   )r   r8   r3   r3   r3   r4   r9     r:   z(test_Method_preprocess.<locals>.<lambda>r   r3   r3   r3   r4   test_Method_preprocess  s    r   c                  C   s&   ddi} t |  | ddiks"J d S )NmethodZf5b)r   r=   r>   r3   r3   r4   test_Method_postprocess  s    
r   N)c__doc__Zsympy.polys.polyoptionsr   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zsympy.polys.orderingsr   Zsympy.polys.domainsr   r   r   r   r   r    r!   r"   Zsympy.polys.polyerrorsr#   r$   Zsympy.core.numbersr%   r&   Zsympy.core.symbolr'   Z(sympy.functions.elementary.miscellaneousr(   Zsympy.testing.pytestr)   Z	sympy.abcr+   r,   r-   r5   r;   r?   rC   rD   rJ   rK   rL   rN   rO   rP   rQ   rS   rT   rU   r]   r`   ra   rd   re   rg   ri   rk   rl   rp   rq   rr   rs   ru   rv   rx   ry   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r3   r3   r3   r4   <module>   sn   h(


@	










