Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/numpy/lib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/numpy/lib/__pycache__/_version.cpython-35.pyc



(��^�@s^dZddlmZmZmZddlZddlmZdgZGdd�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@s�eZdZdZdd�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"

    cCsW||_tjd|�}|s-td��|j�|_dd�|jjd�D�\|_|_|_	t
|�|j�kr�d|_n�tjd||j�d��}tjd||j�d��}tjd	||j�d��}d
d�|||gD�}|r/|dj�|_n	d|_t
tjd
|��|_dS)Nz\d[.]\d+[.]\d+z Not a valid numpy version stringcSsg|]}t|��qS�)�int)�.0�xrr�E/opt/alt/python35/lib64/python3.5/site-packages/numpy/lib/_version.py�
<listcomp>?s	z)NumpyVersion.__init__.<locals>.<listcomp>�.�finalza\dzb\dzrc\dcSs"g|]}|dk	r|�qS)Nr)r	�mrrrrGs	r�z.dev)�vstring�re�match�
ValueError�group�version�split�major�minor�bugfix�len�end�pre_release�bool�search�
is_devversion)�selfrZver_main�alpha�beta�rcZpre_relrrr�__init__8s"		("""	zNumpyVersion.__init__cCs�|j|jkr�|j|jkrc|j|jkr?d}q�|j|jkrZd}q�d}q�|j|jkr~d}q�d}n!|j|jkr�d}nd}|S)zCompare major.minor.bugfixr����r'r')rrr)r!�other�vercmprrr�_compare_versionOs						zNumpyVersion._compare_versioncCsp|j|jkrd}nQ|jdkr3d}n9|jdkrKd}n!|j|jkrfd}nd}|S)zCompare alpha/beta/rc/final.rrr&r'r')r)r!r(r)rrr�_compare_pre_releaseds				z!NumpyVersion._compare_pre_releasecCs�t|ttf�s!td��t|t�r<t|�}|j|�}|dkr�|j|�}|dkr�|j|jkr�d}n|jr�d}nd}|S)Nz,Invalid object to compare with NumpyVersion.rr&r')�
isinstancerrrr*r+r )r!r(r)rrr�_comparess			zNumpyVersion._comparecCs|j|�dkS)Nr)r-)r!r(rrr�__lt__�szNumpyVersion.__lt__cCs|j|�dkS)Nr)r-)r!r(rrr�__le__�szNumpyVersion.__le__cCs|j|�dkS)Nr)r-)r!r(rrr�__eq__�szNumpyVersion.__eq__cCs|j|�dkS)Nr)r-)r!r(rrr�__ne__�szNumpyVersion.__ne__cCs|j|�dkS)Nr)r-)r!r(rrr�__gt__�szNumpyVersion.__gt__cCs|j|�dkS)Nr)r-)r!r(rrr�__ge__�szNumpyVersion.__ge__cCsd|jS)NzNumpyVersion(%s))r)r!rrrZ__repr�szNumpyVersion.__reprN)�__name__�
__module__�__qualname__�__doc__r%r*r+r-r.r/r0r1r2r3Z_NumpyVersion__reprrrrrrs$)
r7�
__future__rrrr�numpy.compatr�__all__rrrrr�<module>s