%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/lib/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/lib/__pycache__/_version.cpython-39.opt-1.pyc

a

z[yc��@s$dZddlZdgZGdd�d�ZdS)aUtility to compare (NumPy) version strings.

The NumpyVersion class allows properly comparing numpy version strings.
The LooseVersion and StrictVersion classes that distutils provides don't
work; they don't recognize anything like alpha/beta/rc/dev versions.

�N�NumpyVersionc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)raParse and compare numpy version strings.

    NumPy has the following versioning scheme (numbers given are examples; they
    can be > 9 in principle):

    - Released version: '1.8.0', '1.8.1', etc.
    - Alpha: '1.8.0a1', '1.8.0a2', etc.
    - Beta: '1.8.0b1', '1.8.0b2', etc.
    - Release candidates: '1.8.0rc1', '1.8.0rc2', etc.
    - Development versions: '1.8.0.dev-f1234afa' (git commit hash appended)
    - Development versions after a1: '1.8.0a1.dev-f1234afa',
                                     '1.8.0b2.dev-f1234afa',
                                     '1.8.1rc1.dev-f1234afa', etc.
    - Development versions (no git hash available): '1.8.0.dev-Unknown'

    Comparing needs to be done against a valid version string or other
    `NumpyVersion` instance. Note that all development versions of the same
    (pre-)release compare equal.

    .. versionadded:: 1.9.0

    Parameters
    ----------
    vstring : str
        NumPy version string (``np.__version__``).

    Examples
    --------
    >>> from numpy.lib import NumpyVersion
    >>> if NumpyVersion(np.__version__) < '1.7.0':
    ...     print('skip')
    >>> # skip

    >>> NumpyVersion('1.7')  # raises ValueError, add ".0"
    Traceback (most recent call last):
        ...
    ValueError: Not a valid numpy version string

    cCs�||_t�d|�}|std��|��|_dd�|j�d�D�\|_|_|_	t
|�|��krbd|_nvt�d||��d��}t�d||��d��}t�d	||��d��}d
d�|||fD�}|r�|d��|_nd|_t
t�d
|��|_dS)Nz
\d+\.\d+\.\d+z Not a valid numpy version stringcSsg|]}t|��qS�)�int)�.0�xrr�8/usr/lib64/python3.9/site-packages/numpy/lib/_version.py�
<listcomp>>�z)NumpyVersion.__init__.<locals>.<listcomp>�.�finalza\dzb\dzrc\dcSsg|]}|dur|�qS)Nr)r�mrrrrFr	r�z.dev)�vstring�re�match�
ValueError�group�version�split�major�minor�bugfix�len�end�pre_release�bool�search�
is_devversion)�selfrZver_mainZalphaZbeta�rcZpre_relrrr�__init__7s$

�zNumpyVersion.__init__cCst|j|jkrZ|j|jkrB|j|jkr*d}qX|j|jkr<d}qXd}qp|j|jkrTd}qpd}n|j|jkrld}nd}|S)zCompare major.minor.bugfixr����)rrr�r�otherZvercmprrr�_compare_versionNszNumpyVersion._compare_versioncCsL|j|jkrd}n6|jdkr"d}n&|jdkr2d}n|j|jkrDd}nd}|S)zCompare alpha/beta/rc/final.rrr!r")rr#rrr�_compare_pre_releasecs

z!NumpyVersion._compare_pre_releasecCsrt|ttf�std��t|t�r(t|�}|�|�}|dkrn|�|�}|dkrn|j|jur^d}n|jrjd}nd}|S)Nz,Invalid object to compare with NumpyVersion.rr"r!)�
isinstance�strrrr%r&rr#rrr�_comparers


zNumpyVersion._comparecCs|�|�dkS�Nr�r)�rr$rrr�__lt__�szNumpyVersion.__lt__cCs|�|�dkSr*r+r,rrr�__le__�szNumpyVersion.__le__cCs|�|�dkSr*r+r,rrr�__eq__�szNumpyVersion.__eq__cCs|�|�dkSr*r+r,rrr�__ne__�szNumpyVersion.__ne__cCs|�|�dkSr*r+r,rrr�__gt__�szNumpyVersion.__gt__cCs|�|�dkSr*r+r,rrr�__ge__�szNumpyVersion.__ge__cCs
d|jS)NzNumpyVersion(%s))r)rrrr�__repr__�szNumpyVersion.__repr__N)�__name__�
__module__�__qualname__�__doc__r r%r&r)r-r.r/r0r1r2r3rrrrrs()r7r�__all__rrrrr�<module>s

Zerion Mini Shell 1.0