Ë
    6Š·jw  ã                   óh   — d dl Z d dlZd dlmZmZmZ d dlmZmZm	Z	m
Z
  G d„ d«      Z G d„ d«      Zy)é    N)ÚfixÚisneginfÚisposinf)Úassert_Úassert_array_equalÚassert_equalÚassert_raisesc                   óÞ   — e Zd Zd„ Zd„ Zej                  j                  d«      d„ «       Zej                  j                  d«      d„ «       Z	ej                  j                  d«      d„ «       Z
y)ÚTestUfunclikec                 ó  — t        j                  t         j                  t         j                   t         j                  dddg«      }t        j                  |j
                  t        «      }t        j                  g d¢«      }t        |«      }t        ||«       t        ||«      }t        ||«       t        ||«       |j                  t         j                  «      }t        t        «      5  t        |«       d d d «       y # 1 sw Y   y xY w)Nç        ç      @ç      À)TFFFFF)ÚnpÚarrayÚinfÚnanÚzerosÚshapeÚboolr   r   ÚastypeÚ
complex128r	   Ú	TypeError©ÚselfÚaÚoutÚtgtÚress        úT/root/workspace/.venv/lib/python3.12/site-packages/numpy/lib/tests/test_ufunclike.pyÚtest_isposinfzTestUfunclike.test_isposinf
   ó·   € Ü�H‰H”b—f‘fœrŸv™v˜g¤r§v¡v¨s°C¸Ð>Ó?ˆÜ�h‰h�q—w‘w¤Ó%ˆÜ�h‰hÒ@ÓAˆä�q‹kˆÜ�S˜#ÔÜ�q˜#ÓˆÜ�S˜#ÔÜ�S˜#Ôà�H‰H”R—]‘]Ó#ˆÜœ9Ó%ñ 	Ü�QŒK÷	÷ 	ñ 	úó   Ã+D Ä D	c                 ó  — t        j                  t         j                  t         j                   t         j                  dddg«      }t        j                  |j
                  t        «      }t        j                  g d¢«      }t        |«      }t        ||«       t        ||«      }t        ||«       t        ||«       |j                  t         j                  «      }t        t        «      5  t        |«       d d d «       y # 1 sw Y   y xY w)Nr   r   r   )FTFFFF)r   r   r   r   r   r   r   r   r   r   r   r	   r   r   s        r    Útest_isneginfzTestUfunclike.test_isneginf   r"   r#   z1ignore:numpy.fix is deprecated:DeprecationWarningc                 óX  — t        j                  g d¢g d¢g«      }t        j                  |j                  t        «      }t        j                  g d¢g d¢g«      }t        |«      }t        ||«       t        ||«      }t        ||«       t        ||«       t        t        d«      d«       y )N)ç      ð?çš™™™™™ñ?ç      ø?gÍÌÌÌÌÌü?)ç      ð¿çš™™™™™ñ¿ç      ø¿gÍÌÌÌÌÌü¿)r'   r'   r'   r'   )r*   r*   r*   r*   ç…ëQ¸	@é   )r   r   r   r   Úfloatr   r   r   s        r    Útest_fixzTestUfunclike.test_fix(   s€   € ä�H‰HÒ*Ò,DÐEÓFˆÜ�h‰h�q—w‘w¤Ó&ˆÜ�h‰hÒ(Ò*>Ð?Ó@ˆä�!‹fˆÜ�S˜#ÔÜ�!�S‹kˆÜ�S˜#ÔÜ�S˜#ÔÜ”S˜“Y Õ"ó    c                 ó°  ‡—  G ˆfd„dt         j                  «      Št        j                  ddg«      } ‰|d¬«      }t        |«      }t	        |t        j                  ddg«      «       t        t        |‰«      «       t        |j                  d«       |d	   }d
|_        t        |«      }t        t        |‰«      «       t        |j                  d
«       y )Nc                   ó(   •— e Zd Zdd„Zdˆ fd„	Zd„ Zy)ú5TestUfunclike.test_fix_with_subclass.<locals>.MyArrayNc                 ó`   — t        j                  |d¬«      j                  | «      }||_        |S )NT)Úcopy)r   r   ÚviewÚmetadata)ÚclsÚdatar8   r   s       r    Ú__new__z=TestUfunclike.test_fix_with_subclass.<locals>.MyArray.__new__8   s)   € Ü—h‘h˜t¨$Ô/×4Ñ4°SÓ9�Ø'�”Ø�
r1   c                 ó|   •— t        |‰«      s|j                  ‰«      }|j                  €| j                  |_        |S ©N)Ú
isinstancer7   r8   )r   ÚobjÚcontextÚreturn_scalarÚMyArrays       €r    Ú__array_wrap__zDTestUfunclike.test_fix_with_subclass.<locals>.MyArray.__array_wrap__=   s5   ø€ Ü! # wÔ/ØŸ(™( 7Ó+�CØ—<‘<Ð'Ø#'§=¡=�C”LØ�
r1   c                 ó*   — t        |dd «      | _        | S )Nr8   )Úgetattrr8   )r   r?   s     r    Ú__array_finalize__zHTestUfunclike.test_fix_with_subclass.<locals>.MyArray.__array_finalize__D   s   € Ü '¨¨Z¸Ó >�”Ø�r1   r=   )NF)Ú__name__Ú
__module__Ú__qualname__r;   rC   rF   )rB   s   €r    rB   r4   7   s   ø„ óõ
ór1   rB   r(   r+   Úfoo)r8   é   éÿÿÿÿ)r   .Úbar)	r   Úndarrayr   r   r   r   r>   r   r8   )r   r   ÚmÚfÚm0dÚf0drB   s         @r    Útest_fix_with_subclassz$TestUfunclike.test_fix_with_subclass5   s¨   ø€ ö	”b—j‘jô 	ô" �H‰H�c˜4�[Ó!ˆÙ�A Ô&ˆÜ�‹FˆÜ˜1œbŸh™h¨¨2 wÓ/Ô0Ü”
˜1˜gÓ&Ô'Ü�Q—Z‘Z Ô'ð �‰iˆØˆŒÜ�#‹hˆÜ”
˜3 Ó(Ô)Ü�S—\‘\ 5Õ)r1   c                 óà  — t         j                  }t        j                  |«      }t         j                  }t	        ||«       t	        t        |«      t        |«      «       d}t        j                  |«      }t        j                  d«      }t	        ||«       t	        t        |«      t        |«      «       t        j                  d«      }t        j                  ||¬«      }t        ||u «       y )Ng333333Àr   r   ©r   )
r   r   r   ÚTrue_r   Útyper   Úfloat64r   r   )r   ÚxÚactualÚexpectedr   s        r    Útest_scalarzTestUfunclike.test_scalarV   s¢   € ä�F‰FˆÜ—‘˜Q“ˆÜ—8‘8ˆÜ�V˜XÔ&Ü”T˜&“\¤4¨£>Ô2àˆÜ—‘˜“ˆÜ—:‘:˜dÓ#ˆÜ�V˜XÔ&Ü”T˜&“\¤4¨£>Ô2ä�h‰h�s‹mˆÜ—‘˜˜sÔ#ˆÜ�˜#�Õr1   N)rG   rH   rI   r!   r%   ÚpytestÚmarkÚfilterwarningsr0   rS   r\   © r1   r    r   r      s|   „ òòð ‡[�[×ÑÐ SÓTñ
#ó Uð
#ð ‡[�[×ÑÐ SÓTñ*ó Uð*ð@ ‡[�[×ÑÐ SÓTñó Uñr1   r   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚTestFixDeprecationz/Test that numpy.fix emits a DeprecationWarning.c                 ó¨   — t        j                  g d¢«      }t        j                  t        d¬«      5  t        |«       d d d «       y # 1 sw Y   y xY w)N)r)   çš™™™™™@r,   gš™™™™™Àúnumpy.fix is deprecated©Úmatch)r   r   r]   ÚwarnsÚDeprecationWarningr   )r   r   s     r    Ú"test_fix_emits_deprecation_warningz5TestFixDeprecation.test_fix_emits_deprecation_warningl   s=   € Ü�H‰HÒ+Ó,ˆÜ�\‰\Ô,Ð4MÔNñ 	Ü�ŒF÷	÷ 	ñ 	ús   ³AÁAc                 óz   — t        j                  t        d¬«      5  t        d«       d d d «       y # 1 sw Y   y xY w)Nre   rf   r-   )r]   rh   ri   r   )r   s    r    Ú)test_fix_scalar_emits_deprecation_warningz<TestFixDeprecation.test_fix_scalar_emits_deprecation_warningq   s.   € Ü�\‰\Ô,Ð4MÔNñ 	Ü�ŒI÷	÷ 	ñ 	ús   œ1±:c                 óê   — t        j                  ddg«      }t        j                  |j                  «      }t	        j
                  t        d¬«      5  t        ||¬«       d d d «       y # 1 sw Y   y xY w)Nr)   rd   re   rf   rU   )r   r   r   r   r]   rh   ri   r   )r   r   r   s      r    Ú+test_fix_with_out_emits_deprecation_warningz>TestFixDeprecation.test_fix_with_out_emits_deprecation_warningu   sT   € Ü�H‰H�c˜3�ZÓ ˆÜ�h‰h�q—w‘wÓˆÜ�\‰\Ô,Ð4MÔNñ 	Ü��s�O÷	÷ 	ñ 	ús   ÁA)Á)A2N)rG   rH   rI   Ú__doc__rj   rl   rn   r`   r1   r    rb   rb   i   s   „ Ù9òò
ór1   rb   )r]   Únumpyr   r   r   r   Únumpy.testingr   r   r   r	   r   rb   r`   r1   r    ú<module>rr      s.   ðÛ ã ß )Ñ )ß RÓ R÷^ñ ^÷Bò r1   