HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/__pycache__/_version.cpython-37.pyc
B

<�Fd�@sDdZddlmZmZmZddlZddlmZdgZGdd�d�Z	dS)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.

�)�division�absolute_import�print_functionN)�
basestring�NumpyVersionc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra�Parse 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"

    cCs�||_t�d|�}|std��|��|_dd�|j�d�D�\|_|_|_	t
|�|��krbd|_nvt�d||��d��}t�d||��d��}t�d	||��d��}d
d�|||gD�}|r�|d��|_nd|_t
t�d
|��|_dS)Nz\d[.]\d+[.]\d+z Not a valid numpy version stringcSsg|]}t|��qS�)�int)�.0�xrr�E/opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/_version.py�
<listcomp>?sz)NumpyVersion.__init__.<locals>.<listcomp>�.�finalza\dzb\dzrc\dcSsg|]}|dk	r|�qS)Nr)r	�mrrrrGsr�z.dev)�vstring�re�match�
ValueError�group�version�split�major�minor�bugfix�len�end�pre_release�bool�search�
is_devversion)�selfrZver_mainZalphaZbetaZrcZpre_relrrr�__init__8s"
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!�other�vercmprrr�_compare_versionOszNumpyVersion._compare_versioncCsL|j|jkrd}n6|jdkr"d}n&|jdkr2d}n|j|jkrDd}nd}|S)zCompare alpha/beta/rc/final.rrr#r$)r)r!r%r&rrr�_compare_pre_releaseds

z!NumpyVersion._compare_pre_releasecCsrt|ttf�std��t|t�r(t|�}|�|�}|dkrn|�|�}|dkrn|j|jkr^d}n|jrjd}nd}|S)Nz,Invalid object to compare with NumpyVersion.rr$r#)�
isinstancerrrr'r(r )r!r%r&rrr�_comparess


zNumpyVersion._comparecCs|�|�dkS)Nr)r*)r!r%rrr�__lt__�szNumpyVersion.__lt__cCs|�|�dkS)Nr)r*)r!r%rrr�__le__�szNumpyVersion.__le__cCs|�|�dkS)Nr)r*)r!r%rrr�__eq__�szNumpyVersion.__eq__cCs|�|�dkS)Nr)r*)r!r%rrr�__ne__�szNumpyVersion.__ne__cCs|�|�dkS)Nr)r*)r!r%rrr�__gt__�szNumpyVersion.__gt__cCs|�|�dkS)Nr)r*)r!r%rrr�__ge__�szNumpyVersion.__ge__cCs
d|jS)NzNumpyVersion(%s))r)r!rrrZ__repr�szNumpyVersion.__reprN)�__name__�
__module__�__qualname__�__doc__r"r'r(r*r+r,r-r.r/r0Z_NumpyVersion__reprrrrrrs$)
r4Z
__future__rrrrZnumpy.compatr�__all__rrrrr�<module>s