
    >qj&                     "   d Z ddlZddlZddlZddlZddlmZ ddl	m
Z
 ddgZg Z eej                  j                        D ]3  Zeevsej                   eej                  j                  e             5  eej                  j"                        D ].  Zej                   eej                  j"                  e             0 eD  cg c]  }  e| ej&                        s|  c} Zej(                  j+                  de      d        Zd Zh d	ZeD cg c]G  }|j2                  |j4                  z
  d
kD  s |j6                  evr|j6                  ej8                  v r|I c}Zej(                  j+                  de      d        Zyc c} w c c}w )a  Test that all ufuncs have float32-preserving signatures.

This was once guaranteed through the code generation script for
generating ufuncs, `scipy/special/_generate_pyx.py`. Starting with
gh-20260, SciPy developers have begun moving to generate ufuncs
through direct use of the NumPy C API (through C++). Existence of
float32 preserving signatures must now be tested since it is no
longer guaranteed.
    N)assert_equal_gen_harmonic_normalized_gen_harmonicufuncc                    t        d | j                  D              }t               }|D ]U  }|j                  |j                  dd      j                  dd      |j                  dd      j                  dd      g       W ||k(  sJ y )Nc              3   @   K   | ]  }d |v sd|v sd|v sd|v s|  ywliqpN .0sigs     h/opt/rentech/trading_bot/.venv/lib/python3.12/site-packages/scipy/special/tests/test_ufunc_signatures.py	<genexpr>z(test_ufunc_signatures.<locals>.<genexpr>+   2      Os
cSjC3J#*  O   dfDF)settypesupdatereplace)r   r   expanded_typesr   s       r   test_ufunc_signaturesr   "   s      Ou{{ O OE
 UN 
[[c"**34[[c"**346	


 N"""    c           
         t        j                  t         j                  t         j                        t        j                  t         j                  t         j                        t        j                  t         j                  t         j
                        t        j                  t         j                  t         j                  dz  z   t         j                        t        j                  t         j                  t         j                  dz  z   t         j                        t        j                  t         j                  t         j                  dz  z   t         j                        d|    S )N)dtypey              ?)r   r   gr   r   G)	npasarraynanfloat32float64
longdouble	complex64
complex128clongdouble)typecodes    r   _get_nan_valr/   9   s    ZZbjj1ZZbjj1ZZbmm4ZZ*",,?ZZ*"--@ZZ*"..A  r    >   bdtrbdtrcbdtrihyp1f1hyp2f1eval_chebyceval_chebyseval_chebyteval_chebyueval_jacobieval_laguerreeval_legendreeval_sh_chebyteval_sh_chebyueval_sh_jacobieval_gegenbauereval_genlaguerreeval_sh_legendre   c                 T   t         j                  j                  d      }t        d | j                  D              }|D ]  }|j                  d      \  }}|D cg c]  }t        |       }}|j                  t        |            }t        j                  ||         rt        d      n
t        d      ||<    | | }	t        |      dk(  r|	gn|	}	t        j                  |	      }	t        |	t        j                  |D cg c]  }t        |       c}      d        y c c}w c c}w )Ni  c              3   @   K   | ]  }d |v sd|v sd|v sd|v s|  ywr	   r   r   s     r   r   ztest_nep50.<locals>.<genexpr>d   r   r   z->r'   rB   T)strict)r%   randomdefault_rngr   r   splitr/   choicelen	isrealobjfloatcomplexr&   r   )
r   rngr   r   input_typesoutput_typesr.   argsidxresults
             r   
test_nep50rT   _   s    ))


%C Ou{{ O OE 
$'IIdO!\ 8CC8X&CCjjT#$&LLc$;E%LS	 .!3&F# 	BJJ|T8X 6TU	

 D  Us   D >D%)__doc__numpyr%   pytestscipy.special._ufuncsscipyscipy.special._gufuncsscipy.specialspecialnumpy.testingr   
exceptions_ufuncsdirfuncnameappendgetattr_gufuncs
isinstancer   markparametrizer   r/   skipsnargsnout__name____all___multi_arg_public_ufuncsrT   )funcr   s   00r   <module>ro      s}        &
 9:

EMM))* AHz!wu}}44h?@A EMM**+ >HNN75==118<=> $
BDz$'A4
B'*# +#,	. %++

":Q">e#'//(I 
  ":;
 <
A Crs   F!F!F7*F