+
    ,ink                        ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIt	^ RI
Ht ^ RIt^ RIt^ RIHt ^ RIHtHtHtHtHtHtHt ^ RIHt ^ RIHt ^ RIHt  ^ R	IH t  R
t! ^ RI#t#R
t$R t&R t']PP                  ! RR
R7      R 4       t)]$'       g   ]PP                  R 4       t*0 RImt+R]	/t,]-! 4       t.]-! 4       t/]'       EdW    ^ RI0t0],Pc                  R]0/4       ]Pd                  ! ]0Pf                  4      ]Ph                  ! R4      8  d	   ]5! R4      h]0Pl                  ! RR7        ^ RI7t7],Pc                  R]7/4       ]7Pp                  ! ]4       ]R8w  d   ].Ps                  R4       ]Pt                  ! RRR7      t;];R8X  d   ]7Px                  ! ]7Pz                  4       M];R 8w  d   ]>! R!]; R"24      h  ^ RI?t?],Pc                  R]?/4       ].Ps                  R4       ]P                  ! R#R$]AR%7       ^ R&IBHCtC AC ^ RIDtE],Pc                  R]EP                  /4       ]EP                  Pc                  R'R
4       ]EP                  Pc                  R(]EP                  ! ]4      ^ ,          4       ]R8w  d   ].Ps                  R4       ]/Ps                  R4        ^ RIHHItJ ],Pc                  R]J/4       ]/Ps                  R4       ]K! ]]L4      '       dL   ]P                  ! 4       RJ9  d6   ] P                  ! ]4      tO]OR).8w  d    ]O U u/ uF  p V ],V ,          bK  	  up t,]-! ],4      ]+,
          '       d   Q h]-! ],4      R0,
          tS]PP                  ! ],P                  4        UUu. uF,  w  r]P                  W!]P                  P                  R,7      NK.  	  uppR-7      R. 4       tX]P                  P                  ]R/R07      tZR1 t[R2 R3 lt\]PP                  R4 4       tG]P                  P                  ]P                  P                  ]P                  ! 4       R54      4       ]P                  P                  R6RR
R77       ]P                  P                  R8RR
RR
]Q! ]P                  4      R97       ]P                  P                  R:R84      tg]P                  P                  ]g4       ]!'       d   ]RKR; l4       ti]i] nj        ]-! . RLO4      ] nk        ]	Pf                  R<8  d$   ] P                  Pc                  ]-! . RMO4      4       . RNO] nl        R=R>R?R>R@RARBRCRDRE/] nm        ]-! RF.4      ] nn        RG. ROO/] no        R
] np        ] P                  Ps                  RH4       R# R#   ]" d    Rt! EL i ; i  ]% d    Rt$ EL	i ; i  ]5 d     ELZi ; i  ]5 d     ELi ; i  ]5 d     ELi ; i  ]5 d     ELi ; i  ]5 d     ELi ; iu up i   ]P d    R*]Q! ],4       R+]O 2tR]>! ]R4      hi ; iu uppi )P    N)contextmanager)Literal)get_fpu_mode)SCIPY_ARRAY_APISCIPY_DEVICEarray_namespace
default_xpis_cupyis_daskis_jax)FPUModeChangeWarning)patch_lazy_xp_functions)_pep440)	dt_configTFc                
   V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4        ^ RIp ^ RIHp \
        '       g9   V P                  RR
4       V P                  RR4       V P                  RR4       R# R#   \         d    T P                  RR4        Lli ; i  \         d    T P                  RR	4        Li ; i)a  
Add pytest markers to avoid PytestUnknownMarkWarning

This needs to contain all markers that are SciPy-specific, as well as
dummy fallbacks for markers defined in optional test packages.

Note that we need both the registration here *and* in `pytest.ini`.
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 platformsz;array_api_backends: test iterates on all array API backendsNz.timeout: mark a test for a non-default timeout)parse_durationz8fail_slow: mark a test for a non-default timeout failurezOparallel_threads(n): run the given test function in parallel using `n` threads.z8thread_unsafe: mark the test function as single-threadedzCiterations(n): run the given test function `n` times in each threadzskip_xp_backends(backends, reason=None, np_only=False, cpu_only=False, eager_only=False, exceptions=None): mark the desired skip configuration for the `skip_xp_backends` fixturezxfail_xp_backends(backends, reason=None, np_only=False, cpu_only=False, eager_only=False, exceptions=None): mark the desired xfail configuration for the `xfail_xp_backends` fixture)addinivalue_linepytest_timeout	Exceptionpytest_fail_slowr   PARALLEL_RUN_AVAILABLE)configr   r   s   &  0/usr/lib/python3/dist-packages/scipy/conftest.pypytest_configurer   $   s1    I)+
IRT
IBD
IEG
I
.0 I
/1
IS 	4
 "!!	" 	F	
 	Q	
 "  IG	II  SQ	SSs$   .B? 3C" ?CC"DDc                    V P                  R 4      pVeI    \        \        P                  P	                  RR4      4      pV'       g   \        P                  ! R4       V P                  R4      pVeP   \        P                  ! ^ 4      P                  ^8  d+   \        P                  ! RVP                  ^ ,           24       \        P                  ! 4       ;_uu_ 4       pVP                  \        P                   4        ^ RIHp R	pV'       dw    \        \        P                  R
,          4      p\        P*                  ! R4      '       g:   \        P,                  ! 4       ^,          p\/        Yv,          ^4      p X! TRR7       RRR4       R#   \
         d    Rp EL`i ; i  \&         d    Rp Li ; i  \(         d     RRR4       R# i ; i  \&         d     RRR4       R# i ; i  + '       g   i     R# ; i)xslowNSCIPY_XSLOW0Fz@very slow test; set environment variable SCIPY_XSLOW=1 to run itxfail_on_32bitz&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_setuprD   Z   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"%();)QST%U"%&86J5 
!	   	A	$  	& %	&  ) 
!	 $ !  = 
!	 67 
!	 	 s   )F  G+ F$G+ F71G+.G+<
GF! F!$F41G+3F44G+7GG+GG+G(G+'G((G++G<	function)scopeautousec              #     "   \        4       pRx  \        4       pW8w  d)   \        P                  ! RVR RVR R2\        ^ R7       R# R# 5i)z1
Check FPU mode was not changed during the test.
NzFPU mode changed from z#xz to z during the test)category
stacklevel)r   warningswarnr   )requestold_modenew_modes   &  r   check_fpu_moderP      sQ     
 ~H	~H.xm4} M! !3	C s   A	Ac                      ^# )    rS       r   num_parallel_threadsrU      s    rT   numpyarray_api_stricttorchcupy	jax.numpy
dask.arrayz2.3z'array-api-strict must be >= version 2.3z2024.12)api_versioncpuSCIPY_DEFAULT_DTYPEfloat64)defaultfloat32zUSCIPY_DEFAULT_DTYPE env var, if set, can only be either 'float64' or 'float32'. Got 'z
' instead.ignorez#cupyx.jit.rawkernel is experimentalrI   )signaljax_enable_x64jax_default_deviceallz!'--array-api-backend' must be in z; got )idmarks)paramsc              #  D  "   \        V R4       \        V R4       V P                  p\        VP                  ^ 4      4      p\        '       d:   \        V P                  WR7       \        V4      ;_uu_ 4        Vx  RRR4       R# Vx  R#   + '       g   i     R# ; i5i)a  Run the test that uses this fixture on each available array API library.

You can select all and only the tests that use the `xp` fixture by
passing `-m array_api_backends` to pytest.

You can select where individual tests run through the `@skip_xp_backends`,
`@xfail_xp_backends`, and `@skip_xp_invalid_arg` pytest markers.

Please read: https://docs.scipy.org/doc/scipy/dev/api-dev/array_api.html#adding-tests
r-   r1   )xprM   monkeypatchN)skip_or_xfail_xp_backendsparamr   emptyr   r   r	   )rM   rm   rl   s   && r   rl   rl     su     " gv. gw/	B	!	%B}}g	
 ^^H ^  ^^s   A5B 7B<B B		B zsTest involves masked arrays, object arrays, or other types that are not valid input when `SCIPY_ARRAY_API` is used.reasonc           	        \        V P                  P                  V R24      4      p\         Uu/ uF  q3. bK  	  ppV EF  p\	        VP
                  4      0 Rm,
          pV'       d   \        RV 24      h\	        VP
                  P                  R. 4      4      pV\        ,
          p\        V\        ,
          4      ;p'       d   \        RV R	\        \        4       24      hVP
                  P                  RR
4      '       dR   VP
                  P                  R4      ;'       g    Rp	\        V,
           F  pWC,          P                  V	4       K  	  MVP
                  P                  RR
4      '       dR   VP
                  P                  R4      ;'       g    Rp	\        V,
           F  pWC,          P                  V	4       K  	  MrVP
                  P                  RR
4      '       dQ   VP
                  P                  R4      ;'       g    Rp	\        V,
           F  pWC,          P                  V	4       K  	  \        VP                  4      ^8X  d   VP                  ^ ,          pV\        9  d   \        RV R\        \        4       24      hVP
                  P                  R4      ;'       g    RV 2p	WC,          P                  ^ V	4       R F#  p
WP
                  9   g   K  \        V
 RV 24      h	  EK  \        VP                  4      ^8  g   EK  \        RVP                   24      h	  VP!                  4        UUu/ uF  w  r;V'       g   K  W;^ ,          bK  	  upp# u upi u uppi )zlA helper for {skip,xfail}_xp_backends.

Return dict of {backend to skip/xfail: top reason to skip/xfail it}
_xp_backendscpu_onlynp_only
eager_onlyrr   
exceptionszInvalid kwargs: zUnknown backend(s): z; must be a subset of Fz"do not run with non-NumPy backendszTno array-agnostic implementation or delegation available for this backend and devicez*eager checks not executed on lazy backendszUnknown backend: z; must be one of z#do not run with array API backend: z is mutually exclusive with z,Please specify only one backend per marker: >   rr   rv   ru   rw   rx   )ru   rv   rw   rx   )listnodeiter_markersxp_known_backendssetkwargs	TypeErrorr*   r+   xp_skip_np_only_backendsappendxp_skip_cpu_only_backendsxp_skip_eager_only_backendslenr2   insertitems)rM   skip_or_xfailr   backendreasonsmarkerinvalid_kwargsrx   invalid_exceptionsrr   kwargbackend_reasonss   &&          r   _backends_kwargs_from_requestr   7  s=   
 7<<,,l-KLMG*;<*;w{*;G<V]]+ /I I.~.>?@@**<<=
'*;;"&z4E'E"FFF34F3G H4489J4K3LN O O ==Y..]]&&x0XX4XF3j@@ ''/ A ]]z511]]&&x0 / /.  5zAA ''/ B ]]|U33]]&&x0 > >< 6CC ''/ D v{{q kk!nG// #4WI >3378I3J2K"M N N]]&&x0 A A5gY?  ##Av.LMM)$w.J7)%TUU M !>v{{mL _ h -4MMO ,;( (GQ'',;   k =j s   M+	M0M0c                V    V ^8  d   QhR\         P                  R\        R,          RR/# )   rM   r   returnN)r-   r1   )r,   FixtureRequestr   )formats   "r   __annotate__r   w  s.     ;% ;%v'<'< ;%-4_-E;%JN;%rT   c                    V R2V P                   9  d   R# \        WR7      pV P                  pVP                  V9   d8   W#P                  ,          pV'       g   Q h\	        \
        V4      pV! VR7       R# R# )a  
Helper of the `xp` fixture.
Skip or xfail based on the ``skip_xp_backends`` or ``xfail_xp_backends`` markers.

See the "Support for the array API standard" docs page for usage examples.

Usage
-----
::
    skip_xp_backends = pytest.mark.skip_xp_backends
    xfail_xp_backends = pytest.mark.xfail_xp_backends
    ...

    @skip_xp_backends(backend, *, reason=None)
    @skip_xp_backends(*, cpu_only=True, exceptions=(), reason=None)
    @skip_xp_backends(*, eager_only=True, exceptions=(), reason=None)
    @skip_xp_backends(*, np_only=True, exceptions=(), reason=None)

    @xfail_xp_backends(backend, *, reason=None)
    @xfail_xp_backends(*, cpu_only=True, exceptions=(), reason=None)
    @xfail_xp_backends(*, eager_only=True, exceptions=(), reason=None)
    @xfail_xp_backends(*, np_only=True, exceptions=(), reason=None)

Parameters
----------
backend : str, optional
    Backend to skip/xfail, e.g. ``"torch"``.
    Mutually exclusive with ``cpu_only``, ``eager_only``, and ``np_only``.
cpu_only : bool, optional
    When ``True``, the test is skipped/xfailed on non-CPU devices,
    minus exceptions. Mutually exclusive with ``backend``.
eager_only : bool, optional
    When ``True``, the test is skipped/xfailed for lazy backends, e.g. those
    with major caveats when invoking ``__array__``, ``__bool__``, ``__float__``,
    or ``__complex__``, minus exceptions. Mutually exclusive with ``backend``.
np_only : bool, optional
    When ``True``, the test is skipped/xfailed for all backends other
    than the default NumPy backend and the exceptions.
    Mutually exclusive with ``backend``. Implies ``cpu_only`` and ``eager_only``.
reason : str, optional
    A reason for the skip/xfail. If omitted, a default reason is used.
exceptions : list[str], optional
    A list of exceptions for use with ``cpu_only``, ``eager_only``, or ``np_only``.
    This should be provided when delegation is implemented for some,
    but not all, non-CPU/non-NumPy backends.
rt   N)r   rq   )keywordsr   ro   __name__getattrr,   )rM   r   skip_xfail_reasonsrl   rr   s   &&   r   rn   rn   w  so    ` %W-=-==6 
B	{{((#KK0v6V$	 )rT   c                   \        V 4      '       d   \        P                  ! RR7       \        V 4      '       d   RR.# \	        V 4      '       d   \        P                  ! RR7       V P                  4       P                  4       R.,           # )aG  Fixture that returns a list of all devices for the backend, plus None.
Used to test input->output device propagation.

Usage
-----
from scipy._lib._array_api import xp_device

def test_device(xp, devices):
    for d in devices:
        x = xp.asarray(..., device=d)
        y = f(x)
        assert xp_device(y) == xp_device(x)
zdata-apis/array-api-compat#293rq   r]   Nzjax-ml/jax#26000)r
   r,   r1   r   r   __array_namespace_info__devices)rl   s   &r   r   r     sf     r{{ 	<=r{{t}bzz 	./&&(002dV;;rT   z.hypothesisnondeterministic)namedeadline
print_blobdeterministic)r   r   r   databasederandomizesuppress_health_checkSCIPY_HYPOTHESIS_PROFILEc           
   #    "   \        4       pRR.pV F  p\        \        RR7      W&   K  	  . ROpV F  p\        \        R7      W&   K  	  ^ RIHp RR.pV F  p\        VP
                  R	R7      W&   K  	  . ROpV F  p\        \        R7      W&   K  	  R
\        \        RR7      R\        R\        R7      R\        RVP
                  R7      /pVP                  V4       \        R4      p	^ RI
Hp
 ^ RIpV
! 4       ;_uu_ 4        VP                  P                  R4       \        P                   ! 4       ;_uu_ 4        V '       d=   V P"                  V9   d,   \        P$                  ! R/ WP"                  ,          B  Rx  M=V '       d   V P"                  V	9   d   Rx  M\        P&                  ! R\(        4       Rx  RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i5i)z]Temporarily 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)rI   messagerc   )	integratezscipy.special.ellip_normalzscipy.special.ellip_harm_2zThe occurrence of roundoffscipy.sparse.linalg.normzExited at iterationz
linalg.rstzthe matrix subclass is not)r   rI   z	stats.rstz"The maximum number of subdivisionsscipy.signal.normalize)_fixed_default_rngNerror)zscipy.signal.cwtzscipy.signal.morletzscipy.signal.morlet2zscipy.signal.rickerzscipy.integrate.simpsonzscipy.interpolate.interp2dzscipy.linalg.kron)zscipy.stats.anderson_ksampzscipy.stats.kurtosistestzscipy.stats.normaltestr   )rb   )dictRuntimeWarningDeprecationWarningscipyr   IntegrationWarningUserWarningPendingDeprecationWarningupdater}   scipy._lib._utilr   rV   randomseedrK   catch_warningsr   filterwarningssimplefilterWarning)testknown_warningsdivide_by_zeror   
deprecatedr   integration_wuser_wdctlegitr   r.   s   &           r   warnings_errors_and_rngr     s       !?
 #D#'0@$BN  #


 D#'1C#DN   	$55
 "D#'1M1M0L$NN  "
HD#'#=N  
 'k3HI979A'::<

 	c" ,- 	8!!IINN4 ((**DII7++ I.<YY.GIdii50))'7; + "!** "!!s=   DG;9G' AG	5G	G'

G;G$G''G8	2	G;2zND_regular_grid.rstzReST parser limitationzextrapolation_examples.rstzsampling_pinv.rstz__cinit__ unexpected argumentzsampling_srou.rstznan in scalar_powerzprobability_distributions.rstzintegration warningzintegrate.nquad(func,zio.rstz.text(>   rY   rV   rX   rW   rZ   r[   )1truerg   )N)zscipy.linalg.LinAlgErrorzscipy.fftpack.fftshiftzscipy.fftpack.ifftshiftzscipy.fftpack.fftfreqzscipy.special.sinczscipy.optimize.show_optionsr   r   z$scipy.io.matlab.MatlabObject.stridesz"scipy.io.matlab.MatlabObject.dtypez"scipy.io.matlab.MatlabOpaque.dtypez$scipy.io.matlab.MatlabOpaque.stridesz&scipy.io.matlab.MatlabFunction.stridesz$scipy.io.matlab.MatlabFunction.dtype)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_configzscipy/special/_precomputez#scipy/interpolate/_interpnd_info.pyz'scipy/interpolate/_rbfinterp_pythran.pyzscipy/_build_utils/tempita.pyzscipy/_lib/array_api_compatzscipy/_lib/highszscipy/_lib/unuranzscipy/_lib/_gcutils.pyzscipy/_lib/doccer.pyzscipy/_lib/_uarrayz+scipy/linalg/_cython_signature_generator.pyzscipy/linalg/_generate_pyx.pyzscipy/linalg/_linalg_pythran.pyz$scipy/linalg/_matfuncs_sqrtm_triu.pyz1scipy/ndimage/utils/generate_label_testvectors.pyz scipy/optimize/_group_columns.pyz$scipy/optimize/_max_len_seq_inner.pyz"scipy/signal/_max_len_seq_inner.pyz%scipy/sparse/_generate_sparsetools.pyzscipy/special/_generate_pyx.pyzscipy/stats/_stats_pythran.py)zoctave_a.matzoctave_cells.matzoctave_struct.mat)rjsonr(   rK   tempfile
contextlibr   typingr   rV   r.   numpy.testingtestingr3   r,   
hypothesisscipy._lib._fpumoder   scipy._lib._array_apir   r   r   r	   r
   r   r   scipy._lib._testutilsr   "scipy._lib.array_api_extra.testingr   
scipy._libr   scipy_doctest.conftestr   
HAVE_SCPDTModuleNotFoundErrorpytest_run_parallelr   r   r   rD   fixturerP   rU   r|   xp_available_backendsr}   r   r   rW   r   parse__version__VersionImportErrorset_array_api_strict_flagsrX   set_default_deviceaddr9   r`   set_default_dtyper_   r+   rY   r   FutureWarningcupyx.scipyrd   	jax.numpyjaxr   r   
dask.arrayarrayda
isinstancestrlowerloadsSCIPY_ARRAY_API_r8   ry   msgr   r   ro   r=   array_api_backendsrl   skipifskip_xp_invalid_argr   rn   configurationset_hypothesis_home_dirpathjoin
gettempdirsettingsregister_profileHealthCheckr)   r*   r   load_profiler   user_context_mgrskiplistpytest_extra_ignorepytest_extra_xfail
pseudocodelocal_resourcesstrict_check	stopwords)r   kr>   s   000r   <module>r     sV    	   %      ,   7 F 0J#!
3
l.b j$/C 0C ^^ 
#  " E !e ?	$$&8:J%KL==)5569OOGHH33!	
$$gu%56  .5 %))'2 ))19Ei##EMM2	!%%,IZ9  " 	$$fd^4!%%f- 	;m	
 	'$$k399%=>

*D1

.L0I!0LM5 %))+6 	$''4$$lB%78 	$''5 	?C((!!#+??::o6w&& $4)#3 27;;#3)% $%(999 9945	A  %++-- LL > >L?- #	#L kk((I ) K 
= @;%| < <J    0 0GGLL$$&6    $ $	dt %     $ $	dTtz556 %  ::>>*D*9;  
      !9 :  O Ob "9I  I( 
~~!!# ' # 	,%I!> 	7$&><2')>$I   789I 
!I "I H%i y  J  #"#b  &         )  &:456f=M<NP o%&s   U #U& A#U6 'A8V  V 5AV :BV  *V. >W V<W 2W"
	U#"U#&	U32U36V VVVVV V+*V+.V98V9<W W