| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/site-packages/numpy/lib/__pycache__/ |
Upload File : |
�
�g� � �* � d Z ddlZdgZ G d� d� Zy)a Utility 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 �V � e Zd ZdZdZd� Zd� Zd� Zd� Zd� Zd� Z d � Z
d
� Zd� Zd� Z
d
� Zy)r a� 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.
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
z numpy.libc � � || _ t j d|� }|st d� �|j � | _ | j
j
d� D �cg c]
}t |� �� c}\ | _ | _ | _
t |� |j � k( rd| _
n�t j d||j � d � }t j d||j � d � }t j d||j � d � }|||fD �cg c] }|��|�� }}|r|d j � | _
nd | _
t t j d
|� � | _ y c c}w c c}w )Nz
\d+\.\d+\.\d+z Not a valid numpy version string�.�finalza\dzb\dzrc\dr � z.dev)�vstring�re�match�
ValueError�group�version�split�int�major�minor�bugfix�len�end�pre_release�bool�search�
is_devversion) �selfr �ver_main�x�alpha�beta�rc�m�pre_rels �4C:\Python312\Lib\site-packages\numpy/lib/_version.py�__init__zNumpyVersion.__init__7 s= � �����8�8�,�g�6����?�@�@��~�~�'����L�L���s�#�/%�!�s�1�v� /%�+��
�D�J����w�<�8�<�<�>�)�&�D���H�H�V�W�X�\�\�^�_�%=�>�E��8�8�F�G�H�L�L�N�O�$<�=�D����'�7�8�<�<�>�?�#;�<�B�#(�$��"3�E�Q�q�}�q�E�G�E��#*�1�:�#3�#3�#5�� �#%�� �!�"�)�)�G�W�"=�>����/%�� Fs �E:�%E?�-E?c �f � | j |j k( rx| j |j k( r>| j |j k( rd}|S | j |j kD rd}|S d}|S | j |j kD rd}|S d}|S | j |j kD rd}|S d}|S )zCompare major.minor.bugfixr � ���)r r r �r �other�vercmps r"