
    4[g?              
          d dl Z d dlZd dlZd dlZd dlmZ d dlZd dlm	Z
 d dlZd dlZd dlmZ d dlmZ d dlmZmZ d dlmZ 	 d dlmZ dZd
 Zd Z ej8                  dd      d        ZdeiZerZ eee       rP	 d dl!Z!ejE                  de!i        ejF                  e!jH                         ejJ                  d      k  r e&d       e!jN                  d       	 d dl(Z(ejE                  de(i        e(jR                  e       	 d dl*Z*ejE                  de*i       	 d dl+Z,ejE                  de,j                  i       e,jZ                  jE                  dd       e,jZ                  jE                  d e,j\                  e      d            ej^                         dvr, e j`                  e      Z1de1v rn	 e1D  ci c]  } | e|    
 c} Zdev rdZejl                  jo                  dejq                               Z9ejl                  ju                  ed       Z;ej8                  d!        Z<ejz                  j}                  ej~                  j                   ej                         d"             ej                  j                  d#dd$       ej                  j                  d%dddd eDej                        &       ej                  j                  d'd%      ZHej                  j                  eH       ered6d(       ZJeJe_K         eLg d)      e_M        ejH                  d*k  r#ej                  jE                   eLg d+             g d,e_N        d-d.d.d/d0d1d2e_O         eLd3g      e_P        d4d5gie_Q        yy# e$ r d	ZY 8w xY w# e&$ r Y w xY w# e&$ r Y w xY w# e&$ r Y w xY w# e&$ r Y &w xY wc c} w # e2$ r dejg                          Z4 e5e4      w xY w)7    N)contextmanager)get_fpu_mode)FPUModeChangeWarning)SCIPY_ARRAY_APISCIPY_DEVICE)_pep440)	dt_configTFc                 0   | j                  dd       | j                  dd       | j                  dd       	 dd l}	 ddlm} | j                  dd	       y # t        $ r | j                  dd       Y 7w xY w# t        $ r | j                  dd       Y Qw xY w)
Nmarkerszslow: Tests that are very slow.zHxslow: mark test as extremely slow (not run unless explicitly requested)z8xfail_on_32bit: mark test as failing on 32-bit platformsr   z.timeout: mark a test for a non-default timeout)parse_durationz8fail_slow: mark a test for a non-default timeout failurezskip_xp_backends(*backends, reasons=None, np_only=False, cpu_only=False): mark the desired skip configuration for the `skip_xp_backends` fixture.)addinivalue_linepytest_timeout	Exceptionpytest_fail_slowr   )configr   r   s      I/var/www/html/bid-api/venv/lib/python3.12/site-packages/scipy/conftest.pypytest_configurer      s    
I)+
IRT
IBDIS 	4 I	RS  IG	II  SQ	SSs"   A A7 A43A47BBc                 n   | j                  d      }|A	 t        t        j                  j	                  dd            }|st        j                  d       | j                  d      }|Gt        j                  d      j                  dk  r%t        j                  d	|j                  d           t        j                         5 }|j                  t        j                          	 dd
lm} d}|rc	 t        t        j                  d         }t        j*                  d      s1t        j,                         dz  }t/        ||z  d      }	  |d       d d d        y # t
        $ r d}Y *w xY w# t&        $ r d}Y w xY w# t(        $ r Y d d d        y w xY w# t&        $ r Y d d d        y w xY w# 1 sw Y   y xY w)NxslowSCIPY_XSLOW0Fz@very slow test; set environment variable SCIPY_XSLOW=1 to run itxfail_on_32bitr      z&Fails on our 32-bit test platform(s): )threadpool_limitsTPYTEST_XDIST_WORKER_COUNTOMP_NUM_THREADS      blas)user_api)get_closest_markerintosenvironget
ValueErrorpytestskipnpintpitemsizexfailargsnptsuppress_warningsfilter PytestUnraisableExceptionWarningthreadpoolctlr   r   KeyErrorgetenv	cpu_countmax)	itemmarkvsupr   HAS_THREADPOOLCTLxdist_worker_countmax_openmp_threadsthreads_per_workers	            r   pytest_runtest_setupr?   1   s   ""7+D	BJJNN=#67A KK K L""#34DBGGAJ//!3=diil^LM 
			 C

6::;	&7 $
 
%(4O)P%Q"
 99./%'\\^q%8"%();?Q)QST%U"%&86J5 
!	   	A	$  	& %	&  ) 
!	 $ !  = 
!	 67 
!	 s   )E  F+$E,,F+/E=;F+
FE)(E),E:7F+9E::F+=	FF+FF+	F(F+'F((F++F4function)scopeautousec              #      K   t               }d t               }||k7  r&t        j                  d|dd|ddt        d       yyw)z9
    Check FPU mode was not changed during the test.
    NzFPU mode changed from z#xz to z during the testr   )category
stacklevel)r   warningswarnr   )requestold_modenew_modes      r   check_fpu_moderK   b   sT     
 ~H	~H8.xm4} M! !3	C s   AAnumpyarray_api_strictz2.0z'array-api-strict must be >= version 2.0z2023.12)api_versionpytorchcupy	jax.numpyjax_enable_x64jax_default_device)1trueallz!'--array-api-backend' must be in cudaxpzsTest involves masked arrays, object arrays, or other types that are not valid input when `SCIPY_ARRAY_API` is used.reasonc                    d|j                   vry|j                   d   j                  }|j                   d   j                  }|j                  dd      }|j                  dd      }|r>|j                  ddg      }|d   }| j                  d	k7  rt        j                  |
       y|rd}t        rt        dk7  r| j                  dk(  rt        j                  |
       n| j                  dk(  r>d| j                  d      j                  j                  vrot        j                  |
       nX| j                  dk(  rI| j                  d      j                         D ]'  }d|j                  vst        j                  |
       ) |Y|j                  dd      }t        |      D ]8  \  }	}
| j                  |
k(  s|sd|
 }n||	   }t        j                  |
       : yy)a  
    Skip based on the ``skip_xp_backends`` marker.

    Parameters
    ----------
    *backends : tuple
        Backends to skip, e.g. ``("array_api_strict", "torch")``.
        These are overriden when ``np_only`` is ``True``, and are not
        necessary to provide for non-CPU backends when ``cpu_only`` is ``True``.
    reasons : list, optional
        A list of reasons for each skip. When ``np_only`` is ``True``,
        this should be a singleton list. Otherwise, this should be a list
        of reasons, one for each corresponding backend in ``backends``.
        If unprovided, default reasons are used. Note that it is not possible
        to specify a custom reason with ``cpu_only``. Default: ``None``.
    np_only : bool, optional
        When ``True``, the test is skipped for all backends other
        than the default NumPy backend. There is no need to provide
        any ``backends`` in this case. To specify a reason, pass a
        singleton list to ``reasons``. Default: ``False``.
    cpu_only : bool, optional
        When ``True``, the test is skipped on non-CPU devices.
        There is no need to provide any ``backends`` in this case,
        but any ``backends`` will also be skipped on the CPU.
        Default: ``False``.
    skip_xp_backendsNnp_onlyFcpu_onlyreasonsz#do not run with non-NumPy backends.r   rL   rY   z4do not run with `SCIPY_ARRAY_API` set and not on CPUcpurP   torchrQ   z#do not run with array API backend: )keywordsr-   kwargsr%   __name__r'   r(   r   r   emptydevicetypedevicesdevice_kind	enumerate)rX   rH   backendsrc   r]   r^   r_   rZ   dibackends              r   r\   r\      s   8 !1!11 2388H0188FjjE*Gzz*e,H**Y)N(OP;;'!KKv&G|u4{{f$6*' 2 2 7 77KKv.+!,,.AAMM162 / **Y.#H-JAw{{g%B7)LF$QZF6* .     z.hypothesisnondeterministic)namedeadline
print_blobdeterministic)rq   rr   rs   databasederandomizesuppress_health_checkSCIPY_HYPOTHESIS_PROFILEc              #   ~  K   t               }ddg}|D ]  }t        t        d      ||<    g d}|D ]  }t        t              ||<    ddlm} d	d
g}|D ]  }t        |j
                  d      ||<    g d}|D ]  }t        t              ||<    t        t        d      t        dt              t        d|j
                        d}|j                  |       t        d      }	ddl
m}
 ddl} |
       5  |j                  j                  d       t        j                          5  | r5| j"                  |v r't        j$                  di || j"                      d n3| r| j"                  |	v rd nt        j&                  dt(               d ddd       ddd       y# 1 sw Y   xY w# 1 sw Y   yxY ww)zmTemporarily turn (almost) all warnings to errors.

        Filter out known warnings which we allow.
        zscipy.linalg.normzscipy.ndimage.center_of_masszdivide by zero)rD   message)zscipy.signal.cwtzscipy.signal.morletzscipy.signal.morlet2zscipy.signal.rickerzscipy.integrate.simpsonzscipy.interpolate.interp2d)rD   r   )	integratezscipy.special.ellip_normalzscipy.special.ellip_harm_2zThe occurrence of roundoff)zscipy.stats.anderson_ksampzscipy.stats.kurtosistestzscipy.stats.normaltestscipy.sparse.linalg.normzExited at iterationzthe matrix subclass is not)rz   rD   z"The maximum number of subdivisions)r|   z
linalg.rstz	stats.rstscipy.signal.normalize)_fixed_default_rngNerror)ignore)dictRuntimeWarningDeprecationWarningscipyr{   IntegrationWarningUserWarningPendingDeprecationWarningupdatesetscipy._lib._utilr~   rL   randomseedrF   catch_warningsrq   filterwarningssimplefilterWarning)testknown_warningsdivide_by_zerorq   
deprecatedr{   integration_wuser_wdctlegitr~   r)   s               r   warnings_errors_and_rngr     s       !?
 #D#'0@$BN4  #


 D#'1C#DN4   	$55
 "D#'1M1M0L$NN4  "
HD#'#=N4   k3HI 979 A'::<

 	c" ,- 	8!IINN4 ((*DII7++ I.<TYY.GIdii50))'7; + "!** "!s7   C7F=90F1)A+F%F1	F=%F.	*F11F:6F=)zscipy.linalg.LinAlgErrorzscipy.fftpack.fftshiftzscipy.fftpack.ifftshiftzscipy.fftpack.fftfreqzscipy.special.sinczscipy.optimize.show_optionsr}   r|   2)zscipy.io.hb_readzscipy.io.hb_writez)scipy.sparse.csgraph.connected_componentsz&scipy.sparse.csgraph.depth_first_orderz"scipy.sparse.csgraph.shortest_pathz#scipy.sparse.csgraph.floyd_warshallzscipy.sparse.csgraph.dijkstraz!scipy.sparse.csgraph.bellman_fordzscipy.sparse.csgraph.johnsonzscipy.sparse.csgraph.yenz(scipy.sparse.csgraph.breadth_first_orderz*scipy.sparse.csgraph.reverse_cuthill_mckeez$scipy.sparse.csgraph.structural_rankz*scipy.sparse.csgraph.construct_dist_matrixz%scipy.sparse.csgraph.reconstruct_pathzscipy.ndimage.value_indiceszscipy.stats.mstats.describe)zscipy.stats.distributionszscipy.optimize.cython_optimizez
scipy.testzscipy.show_config zReST parser limitationz__cinit__ unexpected argumentznan in scalar_powerzintegration warning)io.rstzND_regular_grid.rstzextrapolation_examples.rstzsampling_pinv.rstzsampling_srou.rstzprobability_distributions.rstzintegrate.nquad(func,r   zoctave_a.mat)N)Rjsonr#   rF   tempfile
contextlibr   rL   r)   numpy.testingtestingr.   r'   
hypothesisscipy._lib._fpumoder   scipy._lib._testutilsr   scipy._lib._array_apir   r   
scipy._libr   scipy_doctest.conftestr	   
HAVE_SCPDTModuleNotFoundErrorr   r?   fixturerK   xp_available_backends
isinstancestrrM   r   parse__version__VersionImportErrorset_array_api_strict_flagsra   set_default_devicerP   	jax.numpyjaxr   rh   lowerloadsSCIPY_ARRAY_API_r3   keysmsgr&   r8   parametrizevaluesarray_api_compatibleskipifskip_xp_invalid_argr\   configurationset_hypothesis_home_dirpathjoin
gettempdirsettingsregister_profilelistHealthCheckr$   r%   rx   load_profiler   user_context_mgrr   skiplistpytest_extra_ignorepytest_extra_xfail
pseudocodelocal_resources)rn   s   0r   <module>r      s[    	   %     , 6 ? 0J
S0.b j$/C 0C !" z/37	$$&8:J%KL7==)5569OOGHH333!	
$$i%78   .$$fd^4$$k399%=>

*D1

.L0I!0LM
 m3%4::o6$$& $4)#3 27;;#3)% 
""L{{..t5J5Q5Q5ST kk((I ) K 
 <+ <+D    0 0GGLL$$$&6    $ $	dt %     $ $	dTtz556 %  ::>>*D*9;  
      !9 :  N Nb "9I 	 	I 
~~!!# ' # 	,%I! 7&><2)>$I   789I!)N+; <IY w  JR        )  &9:O:T:T:V9WX o%&sz   M: >A!N  )N 
N  "A,N, 9N= =N8
N= :NNNNNN N)(N),N54N58N= =!O