Ë
    èÿæiÊ'  ã                   ó¬   — d dl Z d dlZd dlmZ d dlmZmZmZ d dlm	Z	m
Z
mZ d dlmZmZ ed„ «       Z G d„ de«      Zed	k(  r ej$                  «        yy)
é    N)Úcontextmanager)ÚjitÚ	vectorizeÚguvectorize)ÚNumbaDeprecationWarningÚNumbaPendingDeprecationWarningÚNumbaWarning)ÚTestCaseÚneeds_setuptoolsc               #   óÖ   K  — t        j                  d¬«      5 } t        j                  dt        ¬«       t        j                  dt        ¬«       | –— d d d «       y # 1 sw Y   y xY w­w)NT©ÚrecordÚignore©ÚcategoryÚalways)ÚwarningsÚcatch_warningsÚsimplefilterr	   r   )Úws    úr/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/numba/tests/test_deprecations.pyÚ!_catch_numba_deprecation_warningsr      sG   è ø€ ä	×	 Ñ	 ¨Õ	-°Ü×Ñ˜h´Õ>Ü×Ñ˜hÔ1HÕIØŠ÷ 
.×	-Ñ	-üs   ‚A)™;AÁ	A)ÁA&Á"A)c                   óh  — e Zd Zdd„Zej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Z	ej
                  d„ «       Z
ej
                  d„ «       Zej
                  d„ «       Zej
                  d	„ «       Zej
                  d
„ «       Zej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Zej
                  d„ «       Zeej
                  d„ «       «       Zeej
                  d„ «       «       Zy)ÚTestDeprecationc                 ó  — | j                  t        |«      d«       | j                  |d   j                  |«       | j                  |t	        |d   j
                  «      «       |r)| j                  dt	        |d   j
                  «      «       y y )Né   r   úhttps://numba.readthedocs.io)ÚassertEqualÚlenr   ÚassertInÚstrÚmessage)Úselfr   Úexpected_strr   Ú	check_rtds        r   Úcheck_warningzTestDeprecation.check_warning   sv   € Ø×Ñœ˜X›¨Ô*Ø×Ñ˜ !™×-Ñ-¨xÔ8Ø�‰�l¤C¨°©×(;Ñ(;Ó$<Ô=ÙØ�M‰MÐ8Ü˜h q™k×1Ñ1Ó2õ4ð ó    c                 óª   — t        «       5 }t        d¬«      d„ «       } |«        d}| j                  ||t        d¬«       d d d «       y # 1 sw Y   y xY w)NF©Únopythonc                   ó   — y ©N© r-   r'   r   Úfooz?TestDeprecation.test_explicit_false_nopython_kwarg.<locals>.foo#   s   € àr'   ú2The keyword argument 'nopython=False' was supplied©r%   )r   r   r&   r   ©r#   r   r.   Úmsgs       r   Ú"test_explicit_false_nopython_kwargz2TestDeprecation.test_explicit_false_nopython_kwarg   sS   € ô /Ô0°Aä˜%Ô ñó !ðñ ŒEàFˆCØ×Ñ˜q #Ô'>È%ÐÔP÷ 1×0Ñ0ús   ‹5A	Á	Ac                 ó†   — t        «       5 }t        d«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Núfloat64(float64)c                 ó   — | dz   S ©Nr   r-   ©Úas    r   r.   zOTestDeprecation.test_vectorize_missing_nopython_kwarg_not_reported.<locals>.foo3   ó   € à˜1‘u�r'   ©r   r   ÚassertFalse©r#   r   r.   s      r   Ú2test_vectorize_missing_nopython_kwarg_not_reportedzBTestDeprecation.test_vectorize_missing_nopython_kwarg_not_reported,   sB   € ô
 /Ô0°AäÐ)Ó*ñó +ð÷ 1ð 	×Ñ˜Õ÷ 1Ð0ús	   ‹7·A c                 óž   — t        «       5 }t        dd¬«      d„ «       }d d d «       d}| j                  |t        d¬«       y # 1 sw Y   Œ%xY w)Nr5   Fr)   c                 ó   — | dz   S r7   r-   r8   s    r   r.   zFTestDeprecation.test_vectorize_nopython_false_is_reported.<locals>.foo@   r:   r'   r/   r0   ©r   r   r&   r   r1   s       r   Ú)test_vectorize_nopython_false_is_reportedz9TestDeprecation.test_vectorize_nopython_false_is_reported9   sT   € ô
 /Ô0°AäÐ)°EÔ:ñó ;ð÷ 1ð CˆØ×Ñ˜1˜cÔ#:ÀeÐÕL÷ 1Ð0ús   ‹AÁAc                 óŠ   — t        «       5 }t        dd¬«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Nr5   T©Úforceobjc                 ó    — t        «        | dz   S r7   ©Úobjectr8   s    r   r.   zRTestDeprecation.test_vectorize_objmode_direct_compilation_no_warnings.<locals>.fooM   ó   € ä”Ø˜1‘u�r'   r;   r=   s      r   Ú5test_vectorize_objmode_direct_compilation_no_warningszETestDeprecation.test_vectorize_objmode_direct_compilation_no_warningsG   sD   € ô /Ô0°AäÐ)°DÔ9ñó :ð÷ 1ð 	×Ñ˜Õ÷ 1Ð0úó	   ‹9¹Ac                 ó    — t        «       5 }t        ddd¬«      d„ «       }d d d «       d}| j                  |t        d¬«       y # 1 sw Y   Œ%xY w)Nr5   TF)rE   r*   c                 ó    — t        «        | dz   S r7   rG   r8   s    r   r.   zTTestDeprecation.test_vectorize_objmode_compilation_nopython_false_warns.<locals>.foo[   rI   r'   r/   r0   rA   r1   s       r   Ú7test_vectorize_objmode_compilation_nopython_false_warnszGTestDeprecation.test_vectorize_objmode_compilation_nopython_false_warnsT   sW   € ô
 /Ô0°AäÐ)°DÀ5ÔIñó Jð÷ 1ð CˆØ×Ñ˜1˜cÔ#:ÀeÐÕL÷ 1Ð0úó   ‹AÁAc                 óŠ   — t        «       5 }t        dd¬«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Nr5   Úparallel©Útargetc                 ó   — | dz   S r7   r-   ©Úxs    r   r.   zETestDeprecation.test_vectorize_parallel_true_no_warnings.<locals>.fooi   r:   r'   r;   r=   s      r   Ú(test_vectorize_parallel_true_no_warningsz8TestDeprecation.test_vectorize_parallel_true_no_warningsc   sD   € ô
 /Ô0°AÜÐ)°*Ô=ñó >ð÷ 1ð
 	×Ñ˜Õ÷ 1Ð0úrK   c                 óŒ   — t        «       5 }t        ddd¬«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Nr5   rQ   T©rS   r*   c                 ó   — | dz   S r7   r-   rU   s    r   r.   zSTestDeprecation.test_vectorize_parallel_true_nopython_true_no_warnings.<locals>.foot   r:   r'   r;   r=   s      r   Ú6test_vectorize_parallel_true_nopython_true_no_warningszFTestDeprecation.test_vectorize_parallel_true_nopython_true_no_warningso   sG   € ô /Ô0°AÜÐ)°*ÀtÔLñó Mð÷ 1ð
 	×Ñ˜Õ÷ 1Ð0úó	   ‹:ºAc                 ó    — t        «       5 }t        ddd¬«      d„ «       }d d d «       d}| j                  |t        d¬«       y # 1 sw Y   Œ%xY w)Nr5   rQ   FrY   c                 ó   — | dz   S r7   r-   rU   s    r   r.   zNTestDeprecation.test_vectorize_parallel_true_nopython_false_warns.<locals>.foo   r:   r'   r/   r0   rA   r1   s       r   Ú1test_vectorize_parallel_true_nopython_false_warnszATestDeprecation.test_vectorize_parallel_true_nopython_false_warnsz   sW   € ô /Ô0°AÜÐ)°*ÀuÔMñó Nð÷ 1ð
 CˆØ×Ñ˜1˜cÔ#:ÀeÐÕL÷ 1Ð0úrO   c                 ó–   ‡— t        «       5 }t        dd¬«      ˆfd„«       }d„ Šd d d «       | j                  «       y # 1 sw Y   ŒxY w)Nr5   TrD   c                 ó   •—  ‰| dz   «      S r7   r-   )rV   Úbars    €r   r.   zZTestDeprecation.test_vectorize_calling_jit_with_nopython_false_warns_from_jit.<locals>.foo�   s   ø€ á˜1˜q™5“zÐ!r'   c                   ó   — y r,   r-   )Úargss    r   rb   zZTestDeprecation.test_vectorize_calling_jit_with_nopython_false_warns_from_jit.<locals>.bar“   s   € Ør'   r;   )r#   r   r.   rb   s      @r   Ú=test_vectorize_calling_jit_with_nopython_false_warns_from_jitzMTestDeprecation.test_vectorize_calling_jit_with_nopython_false_warns_from_jit†   sJ   ø€ ô /Ô0°AÜÐ)°DÔ9ó"ó :ð"ò÷ 1ð 	×Ñ˜Õ÷ 1Ð0ús	   Œ?¿Ac                 óˆ   — t        «       5 }t        dd«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Nú void(float64[::1], float64[::1])ú(n)->(n)c                 ó   — | dz  } y r7   r-   ©r9   Úbs     r   rb   zKTestDeprecation.test_guvectorize_implicit_nopython_no_warnings.<locals>.barž   s   € à�Q‘‘r'   ©r   r   r<   ©r#   r   rb   s      r   Ú.test_guvectorize_implicit_nopython_no_warningsz>TestDeprecation.test_guvectorize_implicit_nopython_no_warnings˜   sE   € ô /Ô0°AäÐ;¸ZÓHñó Ið÷ 1ð 	×Ñ˜Õ÷ 1Ð0ús	   ‹8¸Ac                 óŒ   — t        «       5 }t        ddd¬«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Nrg   rh   TrD   c                 ó"   — t        «        | dz  } y r7   rG   rj   s     r   rb   zBTestDeprecation.test_guvectorize_forceobj_no_warnings.<locals>.barª   ó   € ô ”Ø�Q‘‘r'   rl   rm   s      r   Ú%test_guvectorize_forceobj_no_warningsz5TestDeprecation.test_guvectorize_forceobj_no_warnings¤   sI   € ô /Ô0°AäÐ;¸ZØ"&ô(ñó(ð÷	 1ð 	×Ñ˜Õ÷ 1Ð0úr\   c                 óŒ   — t        «       5 }t        ddd¬«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Nrg   rh   rQ   rR   c                 ó   — | dz  } y r7   r-   rj   s     r   rb   zTTestDeprecation.test_guvectorize_parallel_implicit_nopython_no_warnings.<locals>.bar¸   s   € ð �Q‘‘r'   rl   rm   s      r   Ú7test_guvectorize_parallel_implicit_nopython_no_warningszGTestDeprecation.test_guvectorize_parallel_implicit_nopython_no_warnings²   sI   € ô /Ô0°AäÐ;¸ZØ *ô,ñó,ð÷	 1ð 	×Ñ˜Õ÷ 1Ð0úr\   c                 óŽ   — t        «       5 }t        dddd¬«      d„ «       }d d d «       | j                  «       y # 1 sw Y   ŒxY w)Nrg   rh   rQ   T)rS   rE   c                 ó"   — t        «        | dz  } y r7   rG   rj   s     r   rb   zKTestDeprecation.test_guvectorize_parallel_forceobj_no_warnings.<locals>.barÇ   rq   r'   rl   rm   s      r   Ú.test_guvectorize_parallel_forceobj_no_warningsz>TestDeprecation.test_guvectorize_parallel_forceobj_no_warnings¿   sM   € ô /Ô0°Aô Ð;¸ZØ *°Tô;ñó;ð÷ 1ð 	×Ñ˜Õ÷ 1Ð0ús	   ‹;»Ac                 óš  — d„ }d„ }||fD �]0  }|j                   j                  d«      } t        |«      dg«      }t        j                  d¬«      5 }t        j
                  dt        ¬«       t        j
                  d	t        ¬«         t        d¬
«      |«      |«       | j                  t        |«      d«       | j                  |d   j                  t        «       t        |d   j                  «      }d}| j                  ||«       d|z  }| j                  ||«       | j                  d|«       d d d «       �Œ3 y # 1 sw Y   �Œ?xY w)Nc                 ó$   — | j                  d«      S r7   )Úappendr8   s    r   Úfoo_listzFTestDeprecation.test_reflection_of_mutable_container.<locals>.foo_listÒ   s   € Ø—8‘8˜A“;Ðr'   c                 ó$   — | j                  d«      S r7   )Úaddr8   s    r   Úfoo_setzETestDeprecation.test_reflection_of_mutable_container.<locals>.foo_setÕ   s   € Ø—5‘5˜“8ˆOr'   Úfoo_é
   Tr   r   r   r   r)   r   r   z?Encountered the use of a type that is scheduled for deprecationz!'reflected %s' found for argumentr   )Ú__name__ÚstripÚevalr   r   r   r	   r   r   r   r   r   r!   r"   r    )	r#   r|   r   ÚfÚ	containerÚinpr   Úwarn_msgr2   s	            r   Ú$test_reflection_of_mutable_containerz4TestDeprecation.test_reflection_of_mutable_containerÏ   s  € ò	ò	ð ˜GÔ$ˆAØŸ
™
×(Ñ(¨Ó0ˆIØ!”$�y“/ 2 &Ó)ˆCÜ×(Ñ(°Õ5¸Ü×%Ñ% h¼ÕFÜ×%Ñ% hÜ/MõOà%Ð"”˜TÔ" 1Ó% cÔ*Ø× Ñ ¤ Q£¨Ô+Ø× Ñ   1¡§¡Ô0NÔOÜ˜q ™tŸ|™|Ó,�ð%�à—‘˜c 8Ô,Ø<¸yÑH�Ø—‘˜c 8Ô,Ø—‘Ð<¸hÔG÷ 6Ñ5ñ %÷ 6Ñ5ús   ÁC"E Å E
	c                 óÊ   — t        j                  d¬«      5 }t        j                  dt        ¬«       dd l}d}| j                  ||t        «       d d d «       y # 1 sw Y   y xY w)NTr   r   r   r   ú)The 'pycc' module is pending deprecation.)r   r   r   r   Ú
numba.pyccr&   )r#   r   Únumbar$   s       r   Útest_pycc_modulez TestDeprecation.test_pycc_moduleê   sO   € ô
 ×$Ñ$¨DÕ1°QÜ×!Ñ! (Ü+IõKãàGˆLØ×Ñ˜q ,Ô0NÔO÷ 2×1Ñ1ús   —9AÁA"c                 óÎ   — t        j                  d¬«      5 }t        j                  dt        ¬«       ddlm} d}| j                  ||t        «       d d d «       y # 1 sw Y   y xY w)NTr   r   r   r   )ÚCCr‹   )r   r   r   r   rŒ   r�   r&   )r#   r   r�   r$   s       r   Útest_pycc_CCzTestDeprecation.test_pycc_CC÷   sO   € ô
 ×$Ñ$¨DÕ1°QÜ×!Ñ! (Ü+IõKå%àGˆLØ×Ñ˜q ,Ô0NÔO÷ 2×1Ñ1ús   —;AÁA$N)T)r‚   Ú
__module__Ú__qualname__r&   r
   Úrun_test_in_subprocessr3   r>   rB   rJ   rN   rW   r[   r_   re   rn   rr   ru   rx   r‰   r   rŽ   r‘   r-   r'   r   r   r      sÅ  „ ó4ð ×$Ñ$ñQó %ðQð ×$Ñ$ñ
ó %ð
ð ×$Ñ$ñMó %ðMð ×$Ñ$ñ
ó %ð
ð ×$Ñ$ñMó %ðMð ×$Ñ$ñ	ó %ð	ð ×$Ñ$ñó %ðð ×$Ñ$ñ	Mó %ð	Mð ×$Ñ$ñó %ðð" ×$Ñ$ñ	ó %ð	ð ×$Ñ$ñó %ðð ×$Ñ$ñ
ó %ð
ð ×$Ñ$ñó %ðð ×$Ñ$ñHó %ðHð4 Ø×$Ñ$ñ	Pó %ó ð	Pð Ø×$Ñ$ñ	Pó %ó ñ	Pr'   r   Ú__main__)r   ÚunittestÚ
contextlibr   r�   r   r   r   Únumba.core.errorsr   r   r	   Únumba.tests.supportr
   r   r   r   r‚   Úmainr-   r'   r   Ú<module>r›      sb   ðÛ Û Ý %ç -Ñ -÷Mñ Mç :ð ñó ðôoP�hô oPðd ˆzÒØ€H‡M�M…Oð r'   