%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/tests/__pycache__/test_public_api.cpython-39.pyc

a

z[yc,>�@sNddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	zddl
Z
WneyrdZ
Yn0d)dd�Zdd�Z
e	j�dddg�d	d
��Zdd�Zd
d�Zdd�Ze	jje
dudd�dd��Zdd�dD�Zgd�Zdd�dD�Zdd�Zgd�Zdd�Zgd �Zd!d"�Zd#d$�Ze	jje� d%�dud&d�d'd(��Z!dS)*�NcCs`|dur|j}i}t|�D]@}t||�}t|d�rt|d�r|j|kr|jd|j||<q|S)zEReturns a mapping of all objects with the wrong __module__ attribute.N�
__module__�__name__�.)r�dir�getattr�hasattrr)�module�module_name�results�name�item�r
�A/usr/lib64/python3.9/site-packages/numpy/tests/test_public_api.py�	check_dirs
�rcCsHdddddddddd	d
ddd
dddddd�}|}tt�}||ksDJ�dS)Nz,numpy.testing._private.nosetester.NoseTesterz.numpy.core._multiarray_umath._add_newdoc_ufuncz*numpy.core._multiarray_umath.add_docstringz#numpy.core.function_base.add_newdocznumpy.lib.utils.byte_boundsz/numpy.core._multiarray_umath.compare_chararraysznumpy.lib.utils.deprecatez"numpy.lib.utils.deprecate_with_docznumpy.lib.function_base.dispz2numpy.core._multiarray_umath._fastCopyAndTransposez#numpy.lib.shape_base.get_array_wrapznumpy.lib.utils.get_includeznumpy.lib.npyio.recfromcsvznumpy.lib.npyio.recfromtxtznumpy.lib.utils.safe_evalz)numpy.core.arrayprint.set_string_functionznumpy.__config__.showznumpy.lib.utils.who)�TesterZ_add_newdoc_ufuncZ
add_docstringZ
add_newdocZadd_newdoc_ufuncZbyte_boundsZcompare_chararraysZ	deprecateZdeprecate_with_docZdispZfastCopyAndTransposeZget_array_wrapZget_includeZ
recfromcsvZ
recfromtxtZ	safe_evalZset_string_functionZshow_configZwho)r�np)ZundocumentedZ	allowlist�bad_resultsr
r
r�test_numpy_namespace s.�rr�testingrcCs6tjdd|f}t�|�}|r"J�|tt�vs2J�dS)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-czimport numpy; numpy.N)�sys�
executable�
subprocessZcheck_outputrr)rZexe�resultr
r
r�test_import_lazy_import@s
rcCs$ttt��tttt���ks J�dS)zWAssert that output of dir has only one "testing/tester"
    attribute without duplicateN)�lenrr�setr
r
r
r�test_dir_testingVsrcCsttj�}|iksJ�dS�N)rr�linalg�rr
r
r�test_numpy_linalg\s
r cCsttj�}|iksJ�dSr)rr�fftrr
r
r�test_numpy_fftas
r"z#ctypes not available in this python)�reasoncCs0t�tjjj�}t|dd�}|dus,Jd��dS)NZtest_not_exportedzG'test_not_exported' is mistakenly exported, NPY_NO_EXPORT does not work)�ctypesZCDLLr�coreZ_multiarray_tests�__file__r)Zcdll�fr
r
r�test_NPY_NO_EXPORTfsr(cCsg|]}d|�qS�znumpy.r
��.0�sr
r
r�
<listcomp>|�r-)%�	array_apizarray_api.linalgZ	ctypeslibZ	distutilszdistutils.cpuinfozdistutils.exec_commandzdistutils.misc_utilz
distutils.logzdistutils.system_info�docz
doc.constantsz
doc.ufuncsZf2pyr!�libz
lib.formatz
lib.mixinszlib.recfunctionszlib.scimathzlib.stride_tricksrZmaz	ma.extraszma.mrecordsZmatlibZ
polynomialzpolynomial.chebyshevzpolynomial.hermitezpolynomial.hermite_ezpolynomial.laguerrezpolynomial.legendrezpolynomial.polynomialZrandomr�typingztyping.mypy_plugin�version)z
numpy.charznumpy.emathz	numpy.reccCsg|]}d|�qSr)r
r*r
r
rr-�r.)t�compatzcompat.py3kZconftestr%zcore.arrayprintzcore.defchararrayzcore.einsumfunczcore.fromnumericzcore.function_basezcore.getlimitszcore.memmapzcore.multiarrayzcore.numericzcore.numerictypeszcore.overrideszcore.recordszcore.shape_basez
core.umathzcore.umath_testszdistutils.armccompilerzdistutils.ccompilerzdistutils.ccompiler_optzdistutils.commandzdistutils.command.autodistzdistutils.command.bdist_rpmzdistutils.command.buildzdistutils.command.build_clibzdistutils.command.build_extzdistutils.command.build_pyzdistutils.command.build_scriptszdistutils.command.build_srczdistutils.command.configz!distutils.command.config_compilerzdistutils.command.developzdistutils.command.egg_infozdistutils.command.installzdistutils.command.install_clibzdistutils.command.install_dataz!distutils.command.install_headerszdistutils.command.sdistzdistutils.conv_templatezdistutils.corezdistutils.extensionzdistutils.fcompilerzdistutils.fcompiler.absoftzdistutils.fcompiler.armzdistutils.fcompiler.compaqzdistutils.fcompiler.environmentzdistutils.fcompiler.g95zdistutils.fcompiler.gnuzdistutils.fcompiler.hpuxzdistutils.fcompiler.ibmzdistutils.fcompiler.intelzdistutils.fcompiler.laheyzdistutils.fcompiler.mipszdistutils.fcompiler.nagzdistutils.fcompiler.nonezdistutils.fcompiler.pathf95zdistutils.fcompiler.pgzdistutils.fcompiler.nvzdistutils.fcompiler.sunzdistutils.fcompiler.vastzdistutils.fcompiler.fujitsuzdistutils.from_templatezdistutils.intelccompilerzdistutils.lib2defzdistutils.line_endingszdistutils.mingw32ccompilerzdistutils.msvccompilerzdistutils.npy_pkg_configzdistutils.numpy_distributionzdistutils.pathccompilerzdistutils.unixccompilerZdualz
f2py.auxfuncszf2py.capi_mapsz
f2py.cb_ruleszf2py.cfuncszf2py.common_ruleszf2py.crackfortranz
f2py.diagnosezf2py.f2py2ezf2py.f90mod_ruleszf2py.func2subrz
f2py.rulesz
f2py.symboliczf2py.use_rulesz
fft.helperzlib.arraypadzlib.arraysetopszlib.arrayteratorzlib.function_basezlib.histogramszlib.index_trickszlib.nanfunctionsz	lib.npyiozlib.polynomialzlib.shape_basezlib.twodim_basezlib.type_checkz
lib.ufunclikezlib.user_arrayz	lib.utilszlinalg.lapack_litez
linalg.linalgzma.benchzma.corezma.testutilszma.timer_comparisonZ	matrixlibzmatrixlib.defmatrixzpolynomial.polyutilsz
random.mtrandzrandom.bit_generatorztesting.print_coercion_tablesz
testing.utilscCsDd|vsd|vsd|vrdS|tvr(dS|tvr4dS|tvr@dSdS)z%Check if this needs to be considered.z._z.testsz.setupFT)�PUBLIC_MODULES�PUBLIC_ALIASED_MODULES�PRIVATE_BUT_PRESENT_MODULES�rr
r
r�
is_unexpected$sr9)znumpy.core.code_generatorsz!numpy.core.code_generators.genapiz)numpy.core.code_generators.generate_umathz+numpy.core.code_generators.ufunc_docstringsz-numpy.core.code_generators.generate_numpy_apiz-numpy.core.code_generators.generate_ufunc_apiz$numpy.core.code_generators.numpy_apiz-numpy.core.code_generators.generate_umath_docznumpy.core.cversionsznumpy.core.generate_numpy_apiznumpy.distutils.msvc9compilercCsXg}tjtjtjddd�D]$\}}}t|�r|tvr|�|�q|rTtd|����dS)z|
    Test that we don't add anything that looks like a new public module by
    accident.  Check is based on filenames.
    rN)�path�prefix�onerrorzFound unexpected modules: )	�pkgutil�
walk_packagesr�__path__rr9�	SKIP_LIST�append�AssertionError)�modnames�_�modname�ispkgr
r
r�test_all_modules_are_expectedFs�rG)z
numpy.mathznumpy.distutils.log.sysznumpy.doc.constants.reznumpy.doc.constants.textwrapznumpy.lib.emathznumpy.lib.mathznumpy.matlib.charznumpy.matlib.recznumpy.matlib.emathznumpy.matlib.mathznumpy.matlib.linalgznumpy.matlib.fftznumpy.matlib.randomznumpy.matlib.ctypeslibznumpy.matlib.macCs>dd�}|d�}tD]}|�||��q|r:td�|���dS)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)

    cSsxg}t�|�}t|d�r |j}nt|�}|D]F}|�d�s,|d|}tt||�tj	�r,t
|�r,|tvr,|�|�q,|S)N�__all__rDr)
�	importlib�
import_modulerrHr�
startswith�
isinstancer�types�
ModuleTyper9�SKIP_LIST_2rA)�mod_name�membersrZobjnamesZobjnameZfullobjnamer
r
r�find_unexpected_members�s


z@test_all_modules_are_expected_2.<locals>.find_unexpected_members�numpyz5Found unexpected object(s) that look like modules: {}N)r5�extendrB�format)rRZunexpected_membersrEr
r
r�test_all_modules_are_expected_2os�rVc	Cs�dd�}g}tD]}||�s|�|�q|r:td�|���tD].}zt|�Wq>tyj|�|�Yq>0q>|r�td�|���tjdd��H}tj	dt
d�tj	dtd�tD]}||�s�|�|�q�Wd	�n1s�0Y|r�td
�|���d	S)a	
    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	Ss,zt�|�Wnttfy&YdS0dS)NFT)rIrJ�ImportError�AttributeError)r	r
r
r�check_importable�s
z-test_api_importable.<locals>.check_importablez5Modules in the public API that cannot be imported: {}z1Modules in the public API that were not found: {}T)�record�always)�categoryNzPModules that are not really public but looked public and can not be imported: {})
r5rArBrUr6�evalrX�warnings�catch_warnings�filterwarnings�DeprecationWarning�
ImportWarningr7)rYZmodule_namesr	�wr
r
r�test_api_importable�s8��*�rdZPy_DEBUGz�NumPy 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/19800cCs�tj��}z|jdd�}Wnty8|�dg�}Yn0t|�dksNJd��ztdd�|D��}Wnty�t	d�d�Yn0|�
�}d	|j�d
�}|tj
us�J|��dS)z}
    Entry point for Array API implementation can be found with importlib and
    returns the numpy.array_api namespace.
    r/)�grouprz%No entry points for 'array_api' foundcss|]}|jdkr|VqdS)rSNr8)r+�epr
r
r�	<genexpr>�r.z-test_array_api_entry_point.<locals>.<genexpr>z%'numpy' not in array_api entry pointsNznumpy entry point value 'z0' does not point to our Array API implementation)rI�metadataZentry_pointsZselectrX�getr�next�
StopIterationrB�load�valuerSr/)ZepsZxp_epsrfZxp�msgr
r
r�test_array_api_entry_point�s
�ro)N)"rZ	sysconfigrr=rMrIr^rSrZpytestr$rWrrZmarkZparametrizerrr r"Zskipifr(r5r6r7r9r@rGrOrVrdZxfailZget_config_varror
r
r
r�<module>sL


 
�
)x40�

Zerion Mini Shell 1.0