
    bi                         U d Z ddlZddlmZ ddlZddl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 Z e       \  ZZe	j*                  j-                  dee	      d
        Zd Zy)z3Test how the ufuncs in special handle nan inputs.

    N)Callable)assert_array_equalassert_KNOWNFAILURESPOSTPROCESSINGc                     g } g }t        t        j                        D ]  }t        j                  |   }t        |t        j
                        s1t        j                  |      }|#| j                  |       |j                  |       kt        j                  j                  d|      }| j                  t        j                  ||             |j                  |        | |fS )NF)runreason)marks)sortedsc__dict__
isinstancenpufuncr   getappendpytestmarkxfailparam)ufuncsufunc_namesnameobjmsgfails         ^/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/scipy/special/tests/test_nan_inputs.py_get_ufuncsr      s    FKr{{# %kk$#rxx($;MM#t$;;$$s$;DMM&,,s$78t$% ;    func)idsc                    t         j                  f| j                  z  }t        j                         5  t        j
                  ddt               	 t        j                         5  t        j                  dt                | | }d d d        d d d        | t        v rt        |     }d d}t        t        j                  |      d|       y # 1 sw Y   LxY w# t        $ r Y d d d        y w xY w# 1 sw Y   gxY w)Nignore-floating point number truncated to an integerzgot z instead of nanT)err_msg)r   nanninwarningscatch_warningsfilterwarningsRuntimeWarningsimplefilterDeprecationWarning	TypeErrorr   r   isnan)r!   argsresr   s       r   test_nan_inputsr3   (   s    FF9TXXD		 	 	" ;	

	((* "%%h0BCDk" ~T"C(_
%Crxx}dC8" "  	 	 sA   C2C$ CCC	C	C/$C2.C//C22C;c                     t        j                         5  t        j                  ddt               t	        j
                  t        j                  dd      } t        t        j                  |              d d d        y # 1 sw Y   y xY w)Nr$   r%      g      ?)
r)   r*   r+   r,   r   bdtrcr   r'   r   r0   )r2   s    r   test_legacy_castr7   @   sb    		 	 	" ;	

 hhrvvq#&  s   AA==B)__doc__r)   collections.abcr   numpyr   numpy.testingr   r   r   scipy.specialspecialr   r   dictstr__annotations__r   r   UFUNCSUFUNC_NAMESr   parametrizer3   r7    r    r   <module>rE      s     $  5   &(tCM" '&(S(]# ($ "m  [99 :9.r    