U
    iâËd3  ã                   @   s^   d dl Z d dlZd dlmZ d dlmZ dd„ ZG dd„ dejƒZe 	¡  e
dkrZe ¡  dS )	é    N)Úcompile_isolated)Útypesc                    s   ‡ ‡fdd„}|S )Nc                    s.   dd„ }t |ˆ gˆd�}|  | d¡d¡ d S )Nc                 S   s   | }|S )N© )ÚxÚyr   r   úQ/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/numba/tests/test_numconv.pyÚcast	   s    z'template.<locals>.closure.<locals>.cast)ÚargsÚreturn_typeé   )r   ZassertAlmostEqualÚentry_point)Úselfr   Zcres©ÚfromtyÚtotyr   r   Úclosure   s    ztemplate.<locals>.closurer   )r   r   r   r   r   r   Útemplate   s    r   c                   @   s   e Zd ZdZedd„ ƒZdS )ÚTestNumberConversionz�
    Test all int/float numeric conversion to ensure we have all the external
    dependencies to perform these conversions.
    c                 C   sH   t jt jB }tj|dd�D ](\}}dj||d�}t| |t||ƒƒ qd S )Né   )Úrztest_{fromty}_to_{toty}r   )r   Zinteger_domainZreal_domainÚ	itertoolsÚpermutationsÚformatÚsetattrr   )ÚclsZtysr   r   Z	test_namer   r   r   Úautomatic_populate   s    ÿz'TestNumberConversion.automatic_populateN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úclassmethodr   r   r   r   r   r      s   r   Ú__main__)r   ZunittestZnumba.core.compilerr   Z
numba.corer   r   ZTestCaser   r   r   Úmainr   r   r   r   Ú<module>   s   