o
    oh0                     @   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sJ d| v du s#J | ttfdd}| jtttfks7J | jtks>J d| v du sFJ |jttfksOJ |jtksVJ d|v du s^J d S )Ndomainr   orderFr   )gensr/   T)r   r+   r,   r-   r0   r.   r   clone)optnew_opt r4   v/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/sympy/polys/tests/test_polyoptions.pytest_Options_clone   s   r6   c                   C   Z   t ddu s	J t ddu sJ t ddu sJ t ddu s$J ttdd  d S )NFTr      c                   S   
   t tS N)r   
preprocessr+   r4   r4   r4   r5   <lambda>-      
 z(test_Expand_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Expand_preprocess&   
   r>   c                  C   &   ddi} t |  | ddiksJ d S )NexpandT)r   postprocessr2   r4   r4   r5   test_Expand_postprocess0      
rD   c                      s   t ddks	J t tttftttfksJ t tttfftttfks(J tddd ttdd  tt fdd d S )	Nr:   r4   aF)commutativec                   S   s   t tttfS r:   r   r;   r+   r,   r4   r4   r4   r5   r<   >       z&test_Gens_preprocess.<locals>.<lambda>c                      s   t tt fS r:   rH   r4   rF   r4   r5   r<   ?   rI   )r   r;   r+   r,   r-   r'   r)   r$   r4   r4   rJ   r5   test_Gens_preprocess7   s    rK   c                  C   s.   dt tfi} t|  | dt tfiksJ d S )Nr0   )r+   r,   r   rB   rC   r4   r4   r5   test_Gens_postprocessB   s   
rL   c                   C   s   t tdgks
J t dg ksJ t dg ksJ t dddgks'J t dddgks2J t dddgks=J t dddgksHJ t d	ddgksSJ t d
ddgks^J t ttgddgkskJ 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   
   t dS )N,r   r;   r4   r4   r4   r5   r<   U   r=   z%test_Wrt_preprocess.<locals>.<lambda>c                   S   rO   Nr   rQ   r4   r4   r4   r5   r<   V   r=   )r   r;   r+   r,   r)   r#   r4   r4   r4   r5   test_Wrt_preprocessI   s   rS   c                  C   s*   ddgi} t |  | ddgiksJ d S )Nwrtr+   )r   rB   rC   r4   r4   r5   test_Wrt_postprocessY   s   

rU   c                   C   s   t tttgg dksJ t tttfg dksJ t dg dks'J t dg dks2J ttdd  ttdd  d S )Nr*   z	x > y > zzx>y>zc                   S   rO   rR   )r   r;   r4   r4   r4   r5   r<   g   r=   z&test_Sort_preprocess.<locals>.<lambda>c                   S   s   t ttthS r:   )r   r;   r+   r,   r-   r4   r4   r4   r5   r<   h   rI   )r   r;   r+   r,   r-   r)   r#   r4   r4   r4   r5   test_Sort_preprocess`   s   rV   c                  C   r@   )Nsortzx > y)r   rB   rC   r4   r4   r5   test_Sort_postprocessk   rE   rX   c                   C   s   t dtks	J d S )Nr   )r   r;   r   r4   r4   r4   r5   test_Order_preprocessr   s   rY   c                  C   r@   )Nr/   T)r   rB   rC   r4   r4   r5   test_Order_postprocessv   rE   rZ   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<      r=   z'test_Field_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Field_preprocess}   r?   r[   c                  C   r@   )NfieldT)r   rB   rC   r4   r4   r5   test_Field_postprocess   rE   r]   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r	   r;   r+   r4   r4   r4   r5   r<      r=   z(test_Greedy_preprocess.<locals>.<lambda>)r	   r;   r)   r#   r4   r4   r4   r5   test_Greedy_preprocess   r?   r^   c                  C   r@   )NgreedyT)r	   rB   rC   r4   r4   r5   test_Greedy_postprocess   rE   r`   c                   C   s  t ttks	J t ttksJ t ttksJ t tdtdks(J t tttf tttf ks9J t dtksBJ t dtksKJ t dtksTJ t dtks]J t dtksfJ t dtdksqJ t d	tdks|J t	t
d
d  t dtt ksJ t dtt ksJ t dtt ksJ t dtt ksJ t dtt ksJ 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sJ t dtttf ksJ t dtttf ks-J t dtttf ks;J t dtttf ksIJ t	t
dd  t dttks]J t dttksjJ t dttkswJ t d ttksJ t d!tttksJ t d"tttksJ t d#tttksJ 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sJ t	t
d)d  d S )*N   ZQr   r   r"   zFF(23)   zGF(23)c                   S   rO   )NzZ[]r
   r;   r4   r4   r4   r5   r<      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   rO   )NzZ()re   r4   r4   r4   r5   r<      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   rO   )Nabcre   r4   r4   r4   r5   r<      r=   )r
   r;   r   r   r"   r   r+   r,   r   r)   r#   r    r!   
frac_fieldalgebraic_fieldr%   r(   r4   r4   r4   r5   test_Domain_preprocess   s^   " 
ri   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
   rB   r+   r,   r   r-   r4   r4   r4   r5   r<      s   
 
z)test_Domain_postprocess.<locals>.<lambda>c                   S   s   t dtdS )Nr4   rj   r
   rB   r"   r4   r4   r4   r5   r<      s    c                   S   s   t dtiS )Nr.   rk   r4   r4   r4   r5   r<          )r)   r$   r4   r4   r4   r5   test_Domain_postprocess   s   rm   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<      r=   z'test_Split_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Split_preprocess   r?   rn   c                   C      t tdd  d S )Nc                   S   s   t ddiS )NsplitT)r   rB   r4   r4   r4   r5   r<      rl   z(test_Split_postprocess.<locals>.<lambda>)r)   NotImplementedErrorr4   r4   r4   r5   test_Split_postprocess      rr   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<      r=   z*test_Gaussian_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Gaussian_preprocess   r?   rt   c                  C   s(   ddi} t |  | dtdksJ d S )NgaussianT)ru   r.   )r   rB   r   rC   r4   r4   r5   test_Gaussian_postprocess   s   
rv   c                   C   s   t ddu s	J t ddu sJ t g d u sJ t tdtdhks)J t tdgtdhks8J t tdtgtdthksIJ ttdd  ttdd  d S )NTr8   ra   c                   S   rO   )NFr   r;   r4   r4   r4   r5   r<     r=   z+test_Extension_preprocess.<locals>.<lambda>c                   S   rO   rR   rw   r4   r4   r4   r5   r<     r=   )r   r;   r(   r%   r)   r#   r4   r4   r4   r5   test_Extension_preprocess
  s   "rx   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	extensionra   )ry   r.   T)r(   r   rB   r   rh   rC   r4   r4   r5   test_Extension_postprocess  s   

rz   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 )Nrd   c                   S   rO   rR   )r   r;   r4   r4   r4   r5   r<   ,  r=   z)test_Modulus_preprocess.<locals>.<lambda>c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<   -  r=   )r   r;   r&   r)   r#   r4   r4   r4   r5   test_Modulus_preprocess(  s   r{   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s+J d S )Nmodulus   )r|   r.   F)r|   	symmetric)r|   r.   r~   )r   rB   r   rC   r4   r4   r5   test_Modulus_postprocess0  s   


r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<   J  r=   z+test_Symmetric_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Symmetric_preprocessC  r?   r   c                  C   r@   )Nr~   T)r   rB   rC   r4   r4   r5   test_Symmetric_postprocessM  rE   r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<   [  r=   z(test_Strict_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Strict_preprocessT  r?   r   c                  C   r@   )NstrictT)r   rB   rC   r4   r4   r5   test_Strict_postprocess^  rE   r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<   l  r=   z&test_Auto_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Auto_preprocesse  r?   r   c                  C   r@   )NautoT)r   rB   rC   r4   r4   r5   test_Auto_postprocesso  rE   r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<   }  r=   z&test_Frac_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Frac_preprocessv  r?   r   c                  C   r@   )NfracT)r   rB   rC   r4   r4   r5   test_Frac_postprocess  rE   r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<     r=   z(test_Formal_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Formal_preprocess  r?   r   c                  C   r@   )NformalT)r   rB   rC   r4   r4   r5   test_Formal_postprocess  rE   r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<     r=   z'test_Polys_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Polys_preprocess  r?   r   c                  C   r@   )NpolysT)r   rB   rC   r4   r4   r5   test_Polys_postprocess  rE   r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<     r=   z)test_Include_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_Include_preprocess  r?   r   c                  C   r@   )NincludeT)r   rB   rC   r4   r4   r5   test_Include_postprocess  rE   r   c                   C   r7   )NFTr   r8   c                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<     r=   z%test_All_preprocess.<locals>.<lambda>)r   r;   r)   r#   r4   r4   r4   r5   test_All_preprocess  r?   r   c                  C   r@   )NallT)r   rB   rC   r4   r4   r5   test_All_postprocess  rE   r   c                  C   s&   dt i} t|  | dt iksJ d S )Ngen)r+   r   rB   rC   r4   r4   r5   test_Gen_postprocess  rE   r   c                   C   ro   )Nc                   S   r9   r:   )r   r;   r+   r4   r4   r4   r5   r<     r=   z)test_Symbols_preprocess.<locals>.<lambda>r)   r#   r4   r4   r4   r5   test_Symbols_preprocess  rs   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   rB   rC   r4   r4   r5   test_Symbols_postprocess  s   
r   c                   C   ro   )Nc                   S   rO   )N
   )r   r;   r4   r4   r4   r5   r<     r=   z(test_Method_preprocess.<locals>.<lambda>r   r4   r4   r4   r5   test_Method_preprocess  rs   r   c                  C   r@   )Nmethodf5b)r   rB   rC   r4   r4   r5   test_Method_postprocess  rE   r   N)c__doc__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   sympy.polys.orderingsr   sympy.polys.domainsr   r   r   r   r   r    r!   r"   sympy.polys.polyerrorsr#   r$   sympy.core.numbersr%   r&   sympy.core.symbolr'   (sympy.functions.elementary.miscellaneousr(   sympy.testing.pytestr)   	sympy.abcr+   r,   r-   r6   r>   rD   rK   rL   rS   rU   rV   rX   rY   rZ   r[   r]   r^   r`   ri   rm   rn   rr   rt   rv   rx   rz   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r4   r4   r4   r5   <module>   sp    h(


@	










