U
    g.?                  
   @   s  d Z ddlZddlZddlmZmZmZmZ ze W n e	k
rL   dZY nX erbej
d n(zddlmZ W n0 ek
r Z zdZeeeW 5 dZ[X Y nX d	d
gZi ZddlmZ ddlmZ ddlT ddlmZ ddlmZ ddlT ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  ddlT ddl!Z"dZ#dZ$dZ%dde$&dfde$&dfde$&d fd!e$&d"fd#e%&d#fgZ'd$d% e'D Z(d&Z#d'e)d(fd)e*d*fd+e+d,fd-e,d.fd/e-d0fd1e.d2fd3e/d4fgZ'dd5d6d!d7d8hZ0e1d9d% e'D  [#['dd:lm2Z2m3Z3m4Z4m5Z5 ej67  e8d;d<g e8ej e8e j e8ej e8d=d>d?d@dAg e9dB [:[;e9d5 e9dC e9dD [<dEdFdGdHdIdJdKdLdMdNg
Z=dOd% e=D Z>ej?dPdQdR ej?dPdSdR ej?dPdTdR dUZ@dUZAdVdW ZBdXdY ZCddZlDmEZE eEeFZG[Ed[d\ ZHeH  [Hd]d^ ZIejJd_krejKd`daNZLeI  dbZMeNeLdkrdc&eLdd jOjFePeLdd jQZMde&eMZeReW 5 Q R X [IddlSZSeSjTUdfdZVejJdgkr<eVdkr<z@dZVeSW jXYdhddi ZZe[djdk eZD ZZeZdlk rdZVW n e\k
r8   dZ]Y nX neVdkrLdZVne^eVZVej_`eV ej_jab  eceSjTUdmdn dodp Zd[SddqlemfZfmgZh [[dS )raS  
NumPy
=====

Provides
  1. An array object of arbitrary homogeneous items
  2. Fast mathematical operations over arrays
  3. Linear Algebra, Fourier Transforms, Random Number Generation

How to use the documentation
----------------------------
Documentation is available in two forms: docstrings provided
with the code, and a loose standing reference guide, available from
`the NumPy homepage <https://numpy.org>`_.

We recommend exploring the docstrings using
`IPython <https://ipython.org>`_, an advanced Python shell with
TAB-completion and introspection capabilities.  See below for further
instructions.

The docstring examples assume that `numpy` has been imported as ``np``::

  >>> import numpy as np

Code snippets are indicated by three greater-than signs::

  >>> x = 42
  >>> x = x + 1

Use the built-in ``help`` function to view a function's docstring::

  >>> help(np.sort)
  ... # doctest: +SKIP

For some objects, ``np.info(obj)`` may provide additional help.  This is
particularly true if you see the line "Help on ufunc object:" at the top
of the help() page.  Ufuncs are implemented in C, not Python, for speed.
The native Python help() does not know how to view their help, but our
np.info() function does.

To search for documents containing a keyword, do::

  >>> np.lookfor('keyword')
  ... # doctest: +SKIP

General-purpose documents like a glossary and help on the basic concepts
of numpy are available under the ``doc`` sub-module::

  >>> from numpy import doc
  >>> help(doc)
  ... # doctest: +SKIP

Available subpackages
---------------------
lib
    Basic functions used by several sub-packages.
random
    Core Random Tools
linalg
    Core Linear Algebra Tools
fft
    Core FFT routines
polynomial
    Polynomial tools
testing
    NumPy testing tools
distutils
    Enhancements to distutils with support for
    Fortran compilers support and more.

Utilities
---------
test
    Run numpy unittests
show_config
    Show numpy build configuration
dual
    Overwrite certain functions with high-performance SciPy tools.
    Note: `numpy.dual` is deprecated.  Use the functions from NumPy or Scipy
    directly instead of importing them from `numpy.dual`.
matlib
    Make everything matrices.
__version__
    NumPy version string

Viewing documentation using IPython
-----------------------------------

Start IPython and import `numpy` usually under the alias ``np``: `import
numpy as np`.  Then, directly past or use the ``%cpaste`` magic to paste
examples into the shell.  To see which functions are available in `numpy`,
type ``np.<TAB>`` (where ``<TAB>`` refers to the TAB key), or use
``np.*cos*?<ENTER>`` (where ``<ENTER>`` refers to the ENTER key) to narrow
down the list.  To view the docstring for a function, use
``np.cos?<ENTER>`` (to view the docstring) and ``np.cos??<ENTER>`` (to view
the source code).

Copies vs. in-place operation
-----------------------------
Most of the functions in `numpy` return a copy of the array argument
(e.g., `np.sort`).  In-place versions of these functions are often
available as array methods, i.e. ``x = np.array([1,2,3]); x.sort()``.
Exceptions to this rule are documented.

    N   )ModuleDeprecationWarningVisibleDeprecationWarning_NoValue	_CopyModeFz%Running from numpy source directory.
)showzError importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.r   r   )_distributor_init)core)*)compat)lib)linalg)fft)
polynomial)random)	ctypeslib)ma)	matrixliba  module 'numpy' has no attribute '{n}'.
`np.{n}` was a deprecated alias for the builtin `{n}`. To avoid this error in existing code, use `{n}` by itself. Doing this will not modify any behavior and is safe. {extended_msg}
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecationszCIf you specifically wanted the numpy scalar type, use `np.{}` here.zWhen replacing `np.{}`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.)object boolbool_floatZfloat64complexZ
complex128strstr_intc                 C   s    i | ]\}}|t j||d qS ))nextended_msg_msgformat).0r   r    r#   2/tmp/pip-unpacked-wheel-2wnnwvus/numpy/__init__.py
<dictcomp>   s    r%   zC`np.{n}` is a deprecated alias for `{an}`.  (Deprecated NumPy 1.24)Zbool8znp.bool_Zint0znp.intpZuint0znp.uintpZstr0znp.str_Zbytes0z	np.bytes_Zvoid0znp.voidZobject0zk`np.object0` is a deprecated alias for `np.object_`. `object` can be used instead.  (Deprecated NumPy 1.24)longZulongbytesr   c                 C   s&   i | ]\}}}||t j||d fqS ))r   anr   )r"   r   aliasr(   r#   r#   r$   r%      s     )roundabsmaxmin__version__show_configr   r   r   r   r   Z
issubdtypeunicodeArrayteratorZfvZipmtZirrZmirrZnperZnpvZpmtZppmtpvZratec                 C   s   i | ]}|d | dqS )z(In accordance with NEP 32, the function z was removed from NumPy version 1.20.  A replacement for this function is available in the numpy_financial library: https://pypi.org/project/numpy-financialr#   )r"   namer#   r#   r$   r%      s    ignoreznumpy.dtype size changed)messageznumpy.ufunc size changedznumpy.ndarray size changedremovedc                    s   dd l }zt|   W n tk
r(   Y n"X |j tdd  fdd}|S zt|  \} W n tk
rn   Y nX |j tdd |S | tkr|jd|  dtdd | tkrt	t|  | dkrdd l
m} |S | d	krd
dlm} |S t	dt| d S )Nr      )
stacklevelc                     s   t  d S N)RuntimeError)argskwdsmsgr#   r$   _expired  s    z__getattr__.<locals>._expiredzIn the future `np.z4` will be defined as the corresponding NumPy scalar.testingTesterr   )rA   z!module {!r} has no attribute {!r})warnings__expired_functions__KeyErrorwarnDeprecationWarning__deprecated_attrs____future_scalars__FutureWarning__former_attrs__AttributeErrorZnumpy.testingr@   rA   r!   __name__)attrrB   r?   valr@   rA   r#   r=   r$   __getattr__  s@    
  rO   c                  C   s&   t   ddhB } | ddh8 } t| S )NrA   r@   r	   r   )globalskeyslist)Zpublic_symbolsr#   r#   r$   __dir__C  s     rS   )PytestTesterc                  C   s^   z0t dtd} t| | td dk s.t W n( tk
rX   d}t|tdY nX dS )a  
        Quick sanity checks for common bugs caused by environment.
        There are some cases e.g. with wrong BLAS ABI that cause wrong
        results under specific runtime conditions that are not necessarily
        achieved during test suite runs, and it is useful to catch those early.

        See https://github.com/numpy/numpy/issues/8577 and other
        similar bug reports.

        r7   )Zdtype       @gh㈵>zThe current Numpy installation ({!r}) fails to pass simple sanity checks. This can be caused for example by incorrect BLAS library being linked in, or by mixing package managers (pip, conda, apt, ...). Search closed numpy issues for similar problems.N)ZonesZfloat32r+   dotAssertionErrorr:   r!   __file__)xr>   r#   r#   r$   _sanity_checkO  s    
rZ   c                  C   sR   z8t dddg} tddd}t| |}t||ddd}W n tk
rL   Y nX d	S )
z
        Quick Sanity check for Mac OS look for accelerate build bugs.
        Testing numpy polyfit calls init_dgelsd(LAPACK)
        g      @rU   g      ?r   r7      T)ZcovN)arrayZlinspaceZpolyvalZpolyfit
ValueError)crY   y_r#   r#   r$   _mac_os_checki  s    
ra   darwinT)recordr   z{}: {}a&  Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend.
If you compiled yourself, more information is available at:
https://numpy.org/doc/stable/user/building.html#accelerated-blas-lapack-libraries
Otherwise report this to the vendor that provided NumPy.
{}
ZNUMPY_MADVISE_HUGEPAGElinux.r7   c                 c   s   | ]}t |V  qd S r9   )r   )r"   vr#   r#   r$   	<genexpr>  s     rh   )      ZNPY_PROMOTION_STATElegacyc                  C   s$   ddl m}  t| td gS )Nr   PathZ_pyinstaller)pathlibrm   r   rX   	with_nameresolverl   r#   r#   r$   _pyinstaller_hooks_dir  s    rq   )r.   git_revision)i__doc__sysrB   Z_globalsr   r   r   r   Z__NUMPY_SETUP__	NameErrorstderrwriteZnumpy.__config__r   r/   ImportErrorer>   __all__rG   r   r   r	   r   r   r   r   r   r   r   r   r   Z_matbuiltinsZ	_builtinsr    Z_specific_msgZ_int_extended_msgr!   Z
_type_inforJ   r   ZintpZuintpr   Zbytes_voidZobject_rH   updater*   r+   r,   r-   Z	getlimitsZ_register_known_typesextendremover&   r0   r1   Z_financial_namesrC   filterwarningsZ
oldnumericZnumarrayrO   rS   Znumpy._pytesttesterrT   rL   testrZ   ra   platformcatch_warningswerror_messagelencategoryr   r5   r:   osenvirongetZuse_hugepageunamereleasesplitZkernel_versiontupler]   Zuse_hugepagesr   Z
multiarrayZ_set_madvise_hugepageZ_multiarray_umathZ_reload_guardZ_set_promotion_staterq   versionr.   rr   Z__git_version__r#   r#   r#   r$   <module>   s  i







  3

