o
    iB                     @   s   U d Z ddlmZ ddlZddlmZmZmZ ddl	Z	ddl
mZ i Zeeef ed< i Zeeef ed< dd Ze \ZZe	jje	jjd	eed
dd Zdd ZdS )z3Test how the ufuncs in special handle nan inputs.

    )CallableN)assert_array_equalassert_suppress_warningsKNOWNFAILURESPOSTPROCESSINGc                  C   s   g } g }t tjD ]9}tj| }t|tjsq	t|}|d u r+| | || q	t	j
jd|d}| t	j||d || q	| |fS )NF)runreason)Zmarks)sortedsc__dict__
isinstancenpZufuncr   getappendpytestmarkZxfailparam)ZufuncsZufunc_namesnameobjmsgZfail r   ]/home/kim/smarthome/.venv/lib/python3.10/site-packages/scipy/special/tests/test_nan_inputs.py_get_ufuncs   s   


r   func)Zidsc              	   C   s   t jf| j }t =}|td zt }|t | | }W d    n1 s)w   Y  W n ty?   Y W d    d S w W d    n1 sJw   Y  | tv rYt|  | }d| d}t	t 
|d|d d S )N-floating point number truncated to an integerzgot z instead of nanT)err_msg)r   nanZninr   filterRuntimeWarningDeprecationWarning	TypeErrorr   r   isnan)r   argssupresr   r   r   r   test_nan_inputs&   s*   

r&   c                  C   sV   t  } | td ttjdd}tt| W d    d S 1 s$w   Y  d S )Nr      g      ?)	r   r   r   r   Zbdtrcr   r   r   r"   )r$   r%   r   r   r   test_legacy_cast<   s   "r(   )__doc__typingr   numpyr   Znumpy.testingr   r   r   r   Zscipy.specialZspecialr   r   dictstr__annotations__r   r   ZUFUNCSZUFUNC_NAMESr   Zthread_unsafeZparametrizer&   r(   r   r   r   r   <module>   s    
