+
    CDja                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI	t
^ RIHt ^ RIHt  ^ RItRgR ltR t]P&                  P)                  ]RR7      ]P&                  P+                  RR	.4      R
 4       4       tR tR tR t]P&                  P)                  ]RJ RR7      R 4       t. RNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR	NR+NR,NR-NR.N U u. uF  p R/V ,           NK  	  up t. RhOt. R0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NR;NR<NR=NR>NR?NR@NRANRBNRCNRDNRENRFNRGNRHNRINRJNRKNRLNRMNRNNRONRPNRQNRRNRSNRTNRUNRVN U u. uF  p R/V ,           NK  	  up tRW tRX t. RiOt ]P&                  PB                  RY 4       t"RZ t#]P&                  PI                  ]PJ                  ! R[4      Rj9  R\R7      R] 4       t&R^ t']P&                  PQ                  R_4      R` 4       t)]P&                  PQ                  Ra4      Rb 4       t*Rc t+Rd Re lt,]P&                  PQ                  Ra4      Rf 4       t-R#   ] d    Rt ELi ; iu up i u up i )k    N)IS_WASM)run_subprocessc                8   Vf   V P                   p/ p\        V 4       Fx  pVR8X  d   K  \        W4      p\        VR4      '       g   K+  \        VR4      '       g   K?  VP                  V8w  g   KR  VP                  R,           VP                   ,           W#&   Kz  	  V# )zEReturns a mapping of all objects with the wrong __module__ attribute.core
__module____name__.)r   dirgetattrhasattrr   )modulemodule_nameresultsnameitems   &&   U/data/cameron/venvs/s3viz/lib/python3.14/site-packages/numpy/tests/test_public_api.py	check_dirr      s}    ooGF6>v$D,''GD*,E,EOO{2 OOc1DMMAGM  N    c                  <    R R/p \        \        4      pW8X  g   Q hR# )recarrayznumpy.rec.recarrayN)r   np)	allowlistbad_resultss     r   test_numpy_namespacer   &   s*     	(I B-K ###r   zcan't start subprocess)reasonr   testingc                    \         P                  RRV ,           3p\        V4      pVP                  '       d   Q hV \	        \
        4      9   g   Q hR# )a  Make sure we can actually use the modules we lazy load.

While not exported as part of the public API, it was accessible.  With the
use of __getattr__ and __dir__, this isn't always true It can happen that
an infinite recursion may happen.

This is the only way I found that would force the failure to appear on the
badly implemented code.

We also test for the presence of the lazily imported modules in dir

z-czimport numpy; numpy.N)sys
executabler   stdoutr
   r   )r   exeresults   &  r   test_import_lazy_importr#   1   sE     >>4!7$!>
?CC F}}} 3r7??r   c                     \        \        \        4      4      \        \        \        \        4      4      4      8X  g   Q hR# )zSAssert that output of dir has only one "testing/tester"
attribute without duplicateN)lenr
   r   set r   r   test_dir_testingr(   H   s'     s2w<3s3r7|,,,,r   c                  J    \        \        P                  4      p V / 8X  g   Q hR # N)r   r   linalgr   s    r   test_numpy_linalgr-   N   s    BII&K"r   c                  J    \        \        P                  4      p V / 8X  g   Q hR # r*   )r   r   fftr,   s    r   test_numpy_fftr0   S   s    BFF#K"r   z#ctypes not available in this pythonc                      \         P                  ! \        P                  P                  P
                  4      p \        V R R4      pVe   Q R4       hR# )test_not_exportedNzG'test_not_exported' is mistakenly exported, NPY_NO_EXPORT does not work)ctypesCDLLr   _core_multiarray_tests__file__r   )cdllfs     r   test_NPY_NO_EXPORTr:   X   sG     ;;rxx11::;D)40A9 5 4 59r   	ctypeslibdtypes
exceptionsf2pyr/   libzlib.array_utilsz
lib.formatzlib.introspectz
lib.mixinsz	lib.npyiozlib.recfunctionszlib.scimathzlib.stride_tricksr+   maz	ma.extraszma.mrecords
polynomialzpolynomial.chebyshevzpolynomial.hermitezpolynomial.hermite_ezpolynomial.laguerrezpolynomial.legendrezpolynomial.polynomialrandomstringsztesting.overridestypingztyping.mypy_pluginversionnumpy.conftestr   zcore.multiarrayzcore.numericz
core.umathzcore.arrayprintzcore.defchararrayzcore.einsumfunczcore.fromnumericzcore.function_basezcore.getlimitszcore.numerictypeszcore.overrideszcore.recordszcore.shape_basezf2py.auxfuncszf2py.capi_mapszf2py.cb_ruleszf2py.cfuncszf2py.common_ruleszf2py.crackfortranzf2py.diagnosezf2py.f2py2ezf2py.f90mod_ruleszf2py.func2subrz
f2py.ruleszf2py.symboliczf2py.use_ruleszlib.user_arrayzlinalg.lapack_litezma.corezma.testutilsmatlib	matrixlibzmatrixlib.defmatrixzpolynomial.polyutilszrandom.mtrandzrandom.bit_generatorztesting.print_coercion_tablesc                    RV 9  ;'       dF    RV 9  ;'       d9    RV 9  ;'       d,    V \         9  ;'       d    V \        9  ;'       d
    V \        9  # )z%Check if this needs to be considered.z._z.testsz.setup)PUBLIC_MODULESPUBLIC_ALIASED_MODULESPRIVATE_BUT_PRESENT_MODULESr   s   &r   is_unexpectedrO      sm     	D 	4 	4XT1 	4 	4hd6J 	4 	4&	4 	4..	4 	4 33	r   c                 
   . p \         P                  ! \        P                  \        P                  R,           RR7       F*  w  rp\        V4      '       g   K  V P                  V4       K,  	  V '       d   \        RV  24      hR# )zp
Test that we don't add anything that looks like a new public module by
accident.  Check is based on filenames.
r	   N)pathprefixonerrorzFound unexpected modules: )pkgutilwalk_packagesr   __path__r   rO   appendAssertionError)modnames_modnameispkgs       r   test_all_modules_are_expectedr]      sr     H$22:<++:K;?AE !! OOG$A 9(DEE r   c                     R p V ! R4      p\          F  pVP                  V ! V4      4       K  	  V'       d   \        RV 24      hR# )a  
Method checking all objects. The pkgutil-based method in
`test_all_modules_are_expected` does not catch imports into a namespace,
only filenames.  So this test is more thorough, and checks this like:

    import .lib.scimath as emath

To check if something in a module is (effectively) public, one can check if
there's anything in that namespace that's a public function/object but is
not exposed in a higher-level namespace.  For example for a `numpy.lib`
submodule::

    mod = np.lib.mixins
    for obj in mod.__all__:
        if obj in np.__all__:
            continue
        elif obj in np.lib.__all__:
            continue

        else:
            print(obj)

c                    . p\         P                  ! V 4      p\        VR 4      '       d   VP                  pM\	        V4      pV F  pVP                  R4      '       d   K  V R,           V,           p\        \        W$4      \        P                  4      '       g   KW  \        V4      '       g   Kj  V\        9  g   Kw  VP                  V4       K  	  V# )__all__rZ   r	   )	importlibimport_moduler   r`   r
   
startswith
isinstancer   types
ModuleTyperO   SKIP_LIST_2rW   )mod_namemembersr   objnamesobjnamefullobjnames   &     r   find_unexpected_members@test_all_modules_are_expected_2.<locals>.find_unexpected_members  s    ((269%%~~H6{HG%%c**&nw6gf68H8HII$[11&k9#NN;7   r   numpyz3Found unexpected object(s) that look like modules: N)rK   extendrX   )rm   unexpected_membersr[   s      r   test_all_modules_are_expected_2rr      sY    4$ 19!!!"9'"BC "  ));(<> ? 	? r   c                    R p . p\          F$  pV ! V4      '       d   K  VP                  V4       K&  	  V'       d   \        RV 24      h\         F  p \	        V4       K  	  V'       d   \        RV 24      h\        P                  ! RR7      ;_uu_ 4       p\        P                  ! R\        R7       \        P                  ! R\        R7       \         F$  pV ! V4      '       d   K  VP                  V4       K&  	  RRR4       V'       d   \        R	V 24      hR#   \
         d    TP                  T4        K  i ; i  + '       g   i     LK; i)
z
Check that all submodules listed higher up in this file can be imported

Note that if a PRIVATE_BUT_PRESENT_MODULES entry goes missing, it may
simply need to be removed from the list (deprecation may or may not be
needed - apply common sense).
c                 d     \         P                  ! V 4       R#   \        \        3 d     R # i ; i)FT)ra   rb   ImportErrorAttributeError)r   s   &r   check_importable-test_api_importable.<locals>.check_importable/  s3    	##K0  ^, 		s    //z3Modules in the public API that cannot be imported: z/Modules in the public API that were not found: T)recordalways)categoryNzNModules that are not really public but looked public and can not be imported: )rK   rW   rX   rL   evalrv   warningscatch_warningsfilterwarningsDeprecationWarningImportWarningrM   )rw   module_namesr   ws       r   test_api_importabler   '  s9    L%,,, &  **69 : 	: .	- .  ''3n6 7 	7 
	 	 	-	-3EF=A6K#K00##K0 7 
.  @ ,~/ 0 	0   	-,	- 
.	-s%   DAE*ED?>D?E	Py_DEBUGzNumPy possibly built with `USE_DEBUG=True ./tools/travis-test.sh`, which does not expose the `array_api` entry point. See https://github.com/numpy/numpy/pull/19800c                    \         P                  ! R4      \        P                  9   p \        P
                  P                  4       pVP                  RR7      p\        V4      ^ 8X  d   V '       d   Rp\        V4      RhR#  \        R V 4       4      pTP                  R8X  d   R# TP                  4       pR	TP                   R
2pT\        J g   Q T4       hR#   \         d    T '       d   Rp\        T4      Rh R# i ; i)zl
Entry point for Array API implementation can be found with importlib and
returns the main numpy namespace.
platlib	array_api)groupz%No entry points for 'array_api' foundNc              3   J   "   T F  qP                   R 8X  g   K  Vx  K  	  R# 5i)ro   NrN   ).0eps   & r   	<genexpr>-test_array_api_entry_point.<locals>.<genexpr>r  s     <vG);""vs   #
#z%'numpy' not in array_api entry pointsznumpy.array_apiznumpy entry point value 'z0' does not point to our Array API implementation)	sysconfigget_pathr   r7   ra   metadataentry_pointsselectr%   rX   nextStopIterationvalueloadro   )numpy_in_sitepackagesepsxp_epsmsgr   xps         r   test_array_api_entry_pointr   W  s      &..y9R[[H



)
)
+CZZkZ*F
6{a 9C %4/<v<< 
xx$$ 		B
#BHH: .9 	9  ;;'   9C %4/	s   C C>,C>=C>c                     R p R pV ! \         P                  4      pV! V4      pV ! \         P                  ! 4       4      pV! V4      pW#8X  g   Q RVP                  V4       24       hR# )z|
Checks if `dir(np)` and `np.__all__` are consistent and return
the same content, excluding exceptions and private members.
c                 `    V  Uu0 uF  qP                  R 4      '       d   K  VkK  	  up# u upi )rZ   )rc   )
member_setms   & r   _remove_private_membersFtest_main_namespace_all_dir_coherence.<locals>._remove_private_members  s%    %?:a\\#->:???s   ++c                 &    V P                  R 04      # bool)
difference)r   s   &r   _remove_exceptionsAtest_main_namespace_all_dir_coherence.<locals>._remove_exceptions  s    $$&
  	r   zMembers that break symmetry: N)r   r`   __dir__symmetric_difference)r   r   all_membersdir_memberss       r   %test_main_namespace_all_dir_coherencer     sm    
@
 *"**5K$[1K)"**,7K$[1K% '++K8
9	;%r   z:ignore:numpy.core(\.\w+)? is deprecated:DeprecationWarningc                 P   ^ RI Hp  \        \        P                  4       EF  pVP                  R4      '       g   VR9   g   RV 2\        9   d   K2  \        \        P                  V4      p\        P                  ! V4      '       d   VP                  '       dw   VP                  P                  e_   TpTp\        V4       FI  pVP                  R4      '       d   K  \        W54      p\        RV 2V.R7      pV\        Wu4      J d   KI  Q h	  K  V\        W4      J d   EK  Q h	  R# )zd
Check that all "semi-public" members of `numpy._core` are also accessible
from `numpy.core` shims.
NrZ   rF   __znumpy.core.)fromlist)testsrC   )
numpy.corer   r
   r   r5   rc   rL   r   inspectismodule__spec__origin
__import__)r   member_namemember	submodulesubmodule_namesubmodule_member_namesubmodule_membercore_submodules           r   test_core_shims_coherencer     s
    288} ""3''22}%)??;/ V$$FOO$:$:$FI(N),Y%(33D99#*9#L !+!.!1234"
 (7",    *8  WT7777O %r   z+ignore:\w+ chararray \w+:DeprecationWarningc                 v   ^ RI Hp  ^ RIHp ^ RIHp \        0p\        4       p/ p. p\        .p\        V4      ^ 8  Ed   VP                  4       p\        V4       EF  p	\        W4      p
\        P                  ! V
4      '       dk   RV
P                  9   dZ   V	P                  R4      '       gC   RV
P                  9  d2   V	R9  d+   W9  d%   VP!                  V
4       VP#                  V
4       K  \        P$                  ! V
4      '       g$   \'        W\        P(                  34      '       g   K  W9   d   V
P                  R9   d   VP                  R8X  d   K  V
P                  R8X  d%   VP                  P                  R4      '       d   EK3  V
P                  R9   d   VP                  R	8X  d   EKX  VP                  R
8X  d   EKl  VP!                  V
P                  VP                  WZ,          34       EK  VP#                  V
4       VP                  WZ&   EK  	  EK  ???\        V4      ^ 8X  g   Q V4       hR# )z
Check that each public function is available from one location only.

Test performs BFS search traversing NumPy's public API. It flags
any function-like object that is accessible from more that one place.
)Callable)Any)_ArrayFunctionDispatcherro   rZ   numpy._coretrimcoefznumpy.polynomialnumpy.strings
numpy.charN)r>   r@   r   r   )absolutearccosarccosharcsinarcsinharctanarctan2arctanh
left_shiftright_shift	conjugateinvert	remainderdivideconcatenatepower	transposeaddequal	not_equalgreatergreater_equalless
less_equal)collections.abcr   rD   r   numpy._core._multiarray_umathr   r   r&   r%   popr
   r   r   r   r   rc   rW   r   
isfunctionrd   ufunc)r   r   dispatched_functionvisited_modulesvisited_functionsfunctions_original_pathsduplicated_functionsmodules_queuer   r   r   s              r   test_functions_single_locationr     s    ) /1TO14 ?A )+DM
m
q
 ""$v;KV1F   ((6??***3//V__4#EE-$$V,##F+ ""6**6#BCC.  , & 72  :5223EFF   +  !//_<  ,6  )//19; &))&17=,4a 'd 	?,D#$)?+??)r   c            	         \         .p \         0p\        4       p. p\        V 4      ^ 8  Ed    V P                  4       p\	        V4       EF  p\        WE4      p\        P                  ! V4      '       dk   RVP                  9   dZ   VP                  R4      '       gC   RVP                  9  d2   VR9  d+   Wa9  d%   V P                  V4       VP                  V4       K  \        P                  ! V4      '       d   K  \        VR4      '       g   K  VP                  P                  R4      '       d   K  VP                  VP                  8w  g   EK  Wb9  g   EK  VP                  R9   d   VP                  R8X  d   EK6  VP                  R8X  d   VP                  R8X  g#   VP                  R8X  d   VP                  R8X  d   EK}  VP                  R9   d   VP                  R	8X  d   EK  VP                  R9   d   EK  VP                  R
VP                  RVP                  RVP                  /4       VP                  V4       EK  	  EK0  V'       d   \        V4      ^ 8X  g   Q V4       hR# R# )r   ro   rZ   r   r   r   r   ry   	numpy.recznumpy.ctypeslibFuncactualexpectedN)charr   r>   r@   lapack_litemrecordsr   r   rA   rD   mtrandbit_generatorr   )c_long
c_longlong)	BitGenerator	GeneratorMT19937PCG64	PCG64DXSMPhiloxRandomStateSFC64SeedSequence)r   r&   r%   r   r
   r   r   r   r   rc   rW   r   r   r   r   r   r   incorrect_entriesr   r   r   s          r   test___module___attributer  L  s   DMdO
m
q
 ""$v;KV1F   ((6??***3//V__4 $ 
 -$$V,##F+$$V,,
++OO..s33!!V__4/ ?? '  oo8 __
2v'7Q__0V__5S OO'??OO'88 ?? '  !(( &"3"3"FOO "%%f-y '| $%*=,==* r   c                $    V ^8  d   QhR\         /# )   returnr   )formats   "r   __annotate__r
    s      t r   c                    V P                   pV P                  pV P                  pW!P                  R 4      R,          8X  g   Q h\        P
                  V,          p\        P                  ! \        VP                  R 4      V4      pWPJ ;'       gY    \        VR4      ;'       dE    \        V R4      ;'       d1    VP                  V P                  8H  ;'       d    VP                   V8H  # )r	   __get____self__)
__qualname__r   r   splitr   modules	functoolsreducer   r   )objqualnamer   r   r   
actual_objs   &     r   "_check_correct_qualname_and_moduler    s    H<<D..K>>#&r****[[%F!!'8>>#+>GJ 	
 	
 J	* 0 0wsJ/G 0 0!!S^^30 0##x/r   c            	         \         .p \         0p\        4       p. p\        V 4      ^ 8  Ed   V P                  4       p\	        V4       EFo  p\        WE4      p\        P                  ! V4      '       dk   RVP                  9   dZ   VP                  R4      '       gC   VR	9  d<   RVP                  9  d+   Wa9  d%   V P                  V4       VP                  V4       K  \        P                  ! V4      '       d   K  \        VR4      '       g   K  VP                  P                  R4      '       d   K  VP                  R4      '       d   EK  \        V4      '       d   EK  Wb9  g   EK!  VP                  RVP                   RV 2RVP                   RVP                   2/4       VP                  V4       EKr  	  EK  V'       d   \        V4      ^ 8X  g   Q V4       hR# R# )
r   ro   rZ   r   r   found_at:
advertisesN>   r   rD   )r   r&   r%   r   r
   r   r   r   r   rc   rW   r   r   r  r   r  r  s          r   *test___qualname___and___module___attributer    s   
 DMdO
m
q
 ""$v;KV1F   ((6??***3//#66V__4-$$V,##F+$$V,,
++OO..s33**3//6v>>/!(("v&7q$F$):):(;1V=P=P<Q&R "%%f-7 ': $%*=,==* r   r*   )r   znumpy.emathr   )
znumpy.matlib.charznumpy.matlib.recznumpy.matlib.emathznumpy.matlib.exceptionsznumpy.matlib.mathznumpy.matlib.linalgznumpy.matlib.fftznumpy.matlib.randomznumpy.matlib.ctypeslibznumpy.matlib.ma)Nr   0).r  ra   r   rT   r   r   re   r}   pytestro   r   numpy.testingr   numpy.testing._private.utilsr   r3   ru   r   r   markskipifparametrizer#   r(   r-   r0   r:   rK   rL   rM   rO   r]   rg   slowrr   r   xfailget_config_varr   r   r   r   r   r  r  r  )ss   0r   <module>r(     s       
       ! 7
$ G$<=)- . >*-

 FdN@  B5B5(!)!)!) !) 	!)
 
!) 
!) !) !) !) !) !) !) !) !) !)  	!!)" #!)$ %!)& '!)( )!)* +!), -!). /!)0 1!)2 3!)4 5!)6 7!)8 9!): ;!)< =!)> ?!)@ A!) ! !)1(Q,, !) !H (6(6
(6 (6 	(6
 (6 (6 (6 (6 (6 (6 (6 (6 (6 (6 (6  !(6" #(6$ %(6& '(6( )(6* +(6, -(6. /(60 1(62 3(64 5(66 7(68 9(6: ;(6< =(6> ?(6@ A(6B C(6D E(6F G(6H I(6J K(6L M(6N $O(6 ( (6x!|| (6 ( VF, 1? 1?h-0` Z(>	8  ''T2 A.8.8b JKr@ Lr@jG>T& JK)> L)>o  Fv!V(s   I ;I&I 	II