U
    #c1/                     @   sp  d Z ddlZddlZddlmZ ddlmZ ddlmZ dd Z	e	dd	d
ddddddddddddddddgZ
dd Ze \ZZde de dZd d! Zed"d#gd$ ed%g d& ed'g d( ed)g d* ed+g d, ed-g d. ed/g d0 ed1g d2 ed3g d4 ed5g d6 ed7g d8 ed9g d: ed;g d< ed=d>gd? ed@dAgdB edCdDgdE edFdGdHgdI edJdKdLgdM edNg dO edPdQgdR edSdTgdU edVg dW edXg dY edZg d[ ed\d]d^ d_D ]BZed\ed`dajedbf ed\edcdde dee dfe dgf qdhD ]DZed\edidde dje dkeej r^dle dmndn f q&dS )oz
This file is separate from ``_add_newdocs.py`` so that it can be mocked out by
our sphinx ``conf.py`` during doc builds, where we want to avoid showing
platform-dependent information.
    N)dtype)numerictypes)
add_newdocc                    s    fdd}t | S )Nc               	   3   sB    D ]8\} }zt t| }W n tk
r.   Y qX || |fV  qd S )N)getattr_numerictypesAttributeError)aliasdoc
alias_typealiases C/tmp/pip-unpacked-wheel-b2rbor69/numpy/core/_add_newdocs_scalars.pytype_aliases_gen   s    z.numeric_type_aliases.<locals>.type_aliases_gen)list)r   r   r   r   r   numeric_type_aliases   s    	r   )int8z*8-bit signed integer (``-128`` to ``127``))int16z116-bit signed integer (``-32_768`` to ``32_767``))int32z?32-bit signed integer (``-2_147_483_648`` to ``2_147_483_647``))int64zW64-bit signed integer (``-9_223_372_036_854_775_808`` to ``9_223_372_036_854_775_807``))ZintpzJSigned integer large enough to fit pointer, compatible with C ``intptr_t``)uint8z)8-bit unsigned integer (``0`` to ``255``))uint16z-16-bit unsigned integer (``0`` to ``65_535``))uint32z432-bit unsigned integer (``0`` to ``4_294_967_295``))uint64zA64-bit unsigned integer (``0`` to ``18_446_744_073_709_551_615``))ZuintpzMUnsigned integer large enough to fit pointer, compatible with C ``uintptr_t``)Zfloat16zX16-bit-precision floating-point number type: sign bit, 5 bits exponent, 10 bits mantissa)Zfloat32zX32-bit-precision floating-point number type: sign bit, 8 bits exponent, 23 bits mantissa)Zfloat64zY64-bit precision floating-point number type: sign bit, 11 bits exponent, 52 bits mantissa)Zfloat96z496-bit extended-precision floating-point number type)Zfloat128z5128-bit extended-precision floating-point number type)Z	complex64zIComplex number type composed of 2 32-bit-precision floating-point numbers)Z
complex128zIComplex number type composed of 2 64-bit-precision floating-point numbers)Z
complex192zRComplex number type composed of 2 96-bit extended-precision floating-point numbers)Z
complex256zSComplex number type composed of 2 128-bit extended-precision floating-point numbersc                  C   sd   zt  \} }}}}W nD tk
rZ   tj} | dkrRt jddpNt jdd}nd}Y nX | |fS )Nwin32PROCESSOR_ARCHITEW6432 PROCESSOR_ARCHITECTUREunknown)osunamer   sysplatformenvironget)system_machiner   r   r   _get_platform_and_machine6   s    
r(   z:Alias on this platform ( z):c                    s   t t|  t j}|  jkr"dn
d|  d}|rHddd |D }nd}|d fddtD 7 }d|  d| d	| | d}td
| | d S )Nr   z:Canonical name: `numpy.`
    c                 s   s   | ]}d | dV  qdS )z:Alias: `numpy.r*   Nr   ).0r   r   r   r   	<genexpr>O   s   z-add_newdoc_for_scalar_type.<locals>.<genexpr>c                 3   s2   | ]*\}}}| krt  d | d| dV  qdS )z `numpy.z`: z.
    N)_doc_alias_string)r+   r
   r   r	   or   r   r,   S   s    z
    z

    :Character code: ``'z'``
    numpy.core.numerictypes)	r   r   r   char__name__joinpossible_aliasesstripr   )objZfixed_aliasesr	   Zcharacter_codeZcanonical_name_docZ	alias_docZ	docstringr   r.   r   add_newdoc_for_scalar_typeG   s.    





r7   Zbool_Zbool8aD  
    Boolean type (True or False), stored as a byte.

    .. warning::

       The :class:`bool_` type is not a subclass of the :class:`int_` type
       (the :class:`bool_` is not even a number type). This is different
       than Python's default implementation of :class:`bool` as a
       sub-class of :class:`int`.
    bytez:
    Signed integer type, compatible with C ``char``.
    shortz;
    Signed integer type, compatible with C ``short``.
    Zintcz9
    Signed integer type, compatible with C ``int``.
    int_zK
    Signed integer type, compatible with Python `int` and C ``long``.
    Zlonglongz?
    Signed integer type, compatible with C ``long long``.
    ZubytezE
    Unsigned integer type, compatible with C ``unsigned char``.
    ZushortzF
    Unsigned integer type, compatible with C ``unsigned short``.
    ZuintczD
    Unsigned integer type, compatible with C ``unsigned int``.
    ZuintzE
    Unsigned integer type, compatible with C ``unsigned long``.
    Z	ulonglongzH
    Signed integer type, compatible with C ``unsigned long long``.
    halfz4
    Half-precision floating-point number type.
    singlezS
    Single-precision floating-point number type, compatible with C ``float``.
    doubleZfloat_zk
    Double-precision floating-point number type, compatible with Python `float`
    and C ``double``.
    
longdoubleZ	longfloatz
    Extended-precision floating-point number type, compatible with C
    ``long double`` but not necessarily with IEEE 754 quadruple-precision.
    ZcsingleZsinglecomplexzZ
    Complex number type composed of two single-precision floating-point
    numbers.
    ZcdoubleZcfloatZcomplex_z|
    Complex number type composed of two double-precision floating-point
    numbers, compatible with Python `complex`.
    ZclongdoubleZ
clongfloatZlongcomplexz\
    Complex number type composed of two extended-precision floating-point
    numbers.
    Zobject_z
    Any Python object.
    Zstr_Zunicode_aV  
    A unicode string.

    When used in arrays, this type strips trailing null codepoints.

    Unlike the builtin `str`, this supports the :ref:`python:bufferobjects`, exposing its
    contents as UCS4:

    >>> m = memoryview(np.str_("abc"))
    >>> m.format
    '3w'
    >>> m.tobytes()
    b'a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00'
    Zbytes_Zstring_zX
    A byte string.

    When used in arrays, this type strips trailing null bytes.
    voida  
    np.void(length_or_data, /, dtype=None)

    Create a new structured or unstructured void scalar.

    Parameters
    ----------
    length_or_data : int, array-like, bytes-like, object
       One of multiple meanings (see notes).  The length or
       bytes data of an unstructured void.  Or alternatively,
       the data to be stored in the new scalar when `dtype`
       is provided.
       This can be an array-like, in which case an array may
       be returned.
    dtype : dtype, optional
        If provided the dtype of the new scalar.  This dtype must
        be "void" dtype (i.e. a structured or unstructured void,
        see also :ref:`defining-structured-types`).

       ..versionadded:: 1.24

    Notes
    -----
    For historical reasons and because void scalars can represent both
    arbitrary byte data and structured dtypes, the void constructor
    has three calling conventions:

    1. ``np.void(5)`` creates a ``dtype="V5"`` scalar filled with five
       ``\0`` bytes.  The 5 can be a Python or NumPy integer.
    2. ``np.void(b"bytes-like")`` creates a void scalar from the byte string.
       The dtype itemsize will match the byte string length, here ``"V10"``.
    3. When a ``dtype=`` is passed the call is rougly the same as an
       array creation.  However, a void scalar rather than array is returned.

    Please see the examples which show all three different conventions.

    Examples
    --------
    >>> np.void(5)
    void(b'\x00\x00\x00\x00\x00')
    >>> np.void(b'abcd')
    void(b'\x61\x62\x63\x64')
    >>> np.void((5, 3.2, "eggs"), dtype="i,d,S5")
    (5, 3.2, b'eggs')  # looks like a tuple, but is `np.void`
    >>> np.void(3, dtype=[('x', np.int8), ('y', np.int8)])
    (3, 3)  # looks like a tuple, but is `np.void`

    Z
datetime64a  
    If created from a 64-bit integer, it represents an offset from
    ``1970-01-01T00:00:00``.
    If created from string, the string can be in ISO 8601 date
    or datetime format.

    >>> np.datetime64(10, 'Y')
    numpy.datetime64('1980')
    >>> np.datetime64('1980', 'Y')
    numpy.datetime64('1980')
    >>> np.datetime64(10, 'D')
    numpy.datetime64('1970-01-11')

    See :ref:`arrays.datetime` for more information.
    Ztimedelta64zg
    A timedelta stored as a 64-bit integer.

    See :ref:`arrays.datetime` for more information.
    r0   integer)
is_integerz
    integer.is_integer() -> bool

    Return ``True`` if the number is finite with integral value.

    .. versionadded:: 1.22

    Examples
    --------
    >>> np.int64(-2).is_integer()
    True
    >>> np.uint32(5).is_integer()
    True
    )r;   r<   r=   r>   as_integer_ratioa  
        {ftype}.as_integer_ratio() -> (int, int)

        Return a pair of integers, whose ratio is exactly equal to the original
        floating point number, and with a positive denominator.
        Raise `OverflowError` on infinities and a `ValueError` on NaNs.

        >>> np.{ftype}(10.0).as_integer_ratio()
        (10, 1)
        >>> np.{ftype}(0.0).as_integer_ratio()
        (0, 1)
        >>> np.{ftype}(-.25).as_integer_ratio()
        (-1, 4)
        )ZftyperA   z	
        z.is_integer() -> bool

        Return ``True`` if the floating point number is finite with integral
        value, and ``False`` otherwise.

        .. versionadded:: 1.22

        Examples
        --------
        >>> np.z0(-2.0).is_integer()
        True
        >>> np.z)(3.2).is_integer()
        False
        )r   r   r   r   r   r   r   r   r   r   r   r   Z	bit_countz.bit_count() -> int

        Computes the number of 1-bits in the absolute value of the input.
        Analogous to the builtin `int.bit_count` or ``popcount`` in C++.

        Examples
        --------
        >>> np.z(127).bit_count()
        7z
        >>> np.z%(-127).bit_count()
        7
        r   )__doc__r!   r   Z
numpy.corer   r   r   Znumpy.core.function_baser   r   r4   r(   Z_systemZ_machiner-   r7   Z
float_nameformatZint_namer1   islowerr   r   r   r   <module>   s
  


2
