Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
exceptions.cpython-313.pyc188 linesDownload Raw Back to __pycache__
1�

2z�j����Sr/SQrS\"5;a\"S5eSr"SS\5r"SS\5r"S	S3\	5r4"SS\5r"S
S\5r"SS\
\5r"SS\5rg)a75Exceptions and Warnings6=======================7 8General exceptions used by NumPy.  Note that some exceptions may be module9specific, such as linear algebra errors.10 11.. versionadded:: NumPy 1.2512 13    The exceptions module is new in NumPy 1.25.14 15.. currentmodule:: numpy.exceptions16 17Warnings18--------19.. autosummary::20   :toctree: generated/21 22   ComplexWarning             Given when converting complex to real.23   VisibleDeprecationWarning  Same as a DeprecationWarning, but more visible.24   RankWarning                Issued when the design matrix is rank deficient.25 26Exceptions27----------28.. autosummary::29   :toctree: generated/30 31    AxisError          Given when an axis was invalid.32    DTypePromotionError   Given when no common dtype could be found.33    TooHardError       Error specific to `numpy.shares_memory`.34 35)�ComplexWarning�VisibleDeprecationWarning�ModuleDeprecationWarning�TooHardError�	AxisError�DTypePromotionError�36_is_loadedz'Reloading numpy._globals is not allowedTc��\rSrSrSrSrg)r�/z�37The warning raised when casting a complex dtype to a real dtype.38 39As implemented, casting a complex number to a real discards its imaginary40part, but this behavior may not be what the user actually wants.41 42�N��__name__�43__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r��VD:\code\apps\devtools\python\user_packages\Python313\site-packages\numpy/exceptions.pyrr/����	rrc��\rSrSrSrSrg)r�:a�Module deprecation warning.44 45.. warning::46 47    This warning should not be used, since nose testing is not relevant48    anymore.49 50The nose tester turns ordinary Deprecation warnings into test failures.51That makes it hard to deprecate whole modules, because they get52imported by default. So this is a special Deprecation warning that the53nose tester will let pass without making tests fail.54 55rNrrrrrr:s���	rrc��\rSrSrSrSrg)r�Kz�Visible deprecation warning.56 57By default, python will not show deprecation warnings, so this class58can be used when a very visible warning is helpful, for example because59the usage is most likely a user bug.60 61rNrrrrrrKrrrc��\rSrSrSrSrg)�RankWarning�Vz`Matrix rank warning.62 63Issued by polynomial functions when the design matrix is rank deficient.64 65rNrrrrrrVs���66	rrc��\rSrSrSrSrg)r�`z�``max_work`` was exceeded.67 68This is raised whenever the maximum number of candidate solutions69to consider specified by the ``max_work`` parameter is exceeded.70Assigning a finite number to ``max_work`` may have caused the operation71to fail.72 73rNrrrrrr`s���	rrc�,�\rSrSrSrSrSSjrSrSrg)r�laYAxis supplied was invalid.74 75This is raised whenever an ``axis`` parameter is specified that is larger76than the number of array dimensions.77For compatibility with code written against older numpy versions, which78raised a mixture of :exc:`ValueError` and :exc:`IndexError` for this79situation, this exception subclasses both to ensure that80``except ValueError`` and ``except IndexError`` statements continue81to catch ``AxisError``.82 83Parameters84----------85axis : int or str86    The out of bounds axis or a custom exception message.87    If an axis is provided, then `ndim` should be specified as well.88ndim : int, optional89    The number of array dimensions.90msg_prefix : str, optional91    A prefix for the exception message.92 93Attributes94----------95axis : int, optional96    The out of bounds axis or ``None`` if a custom exception97    message was provided. This should be the axis as passed by98    the user, before any normalization to resolve negative indices.99 100    .. versionadded:: 1.22101ndim : int, optional102    The number of array dimensions or ``None`` if a custom exception103    message was provided.104 105    .. versionadded:: 1.22106 107 108Examples109--------110>>> import numpy as np111>>> array_1d = np.arange(10)112>>> np.cumsum(array_1d, axis=1)113Traceback (most recent call last):114  ...115numpy.exceptions.AxisError: axis 1 is out of bounds for array of dimension 1116 117Negative axes are preserved:118 119>>> np.cumsum(array_1d, axis=-2)120Traceback (most recent call last):121  ...122numpy.exceptions.AxisError: axis -2 is out of bounds for array of dimension 1123 124The class constructor generally takes the axis and arrays'125dimensionality as arguments:126 127>>> print(np.exceptions.AxisError(2, 1, msg_prefix='error'))128error: axis 2 is out of bounds for array of dimension 1129 130Alternatively, a custom exception message can be passed:131 132>>> print(np.exceptions.AxisError('Custom error message'))133Custom error message134 135��_msg�axis�ndimNc�h�X#s=LacO OXlSUlSUlgX0lXlX lg)Nr!)�selfr#r$�136msg_prefixs    r�__init__�AxisError.__init__�s-���%�%��I��D�I��D�I�"�I��I��Irc��URnURnXs=LacUR$ SUSU3nURbURSU3nU$)Nzaxis z) is out of bounds for array of dimension z: )r#r$r")r&r#r$�msgs    r�__str__�AxisError.__str__�sa���y�y���y�y�����9�9�� ��$��H���O�C��y�y�$�����2�c�U�+���Jr)NN)	r
rrrr�	__slots__r(r,rrrrrrls��>�@)�I�	�137rrc��\rSrSrSrSrg)r��a5Multiple DTypes could not be converted to a common one.138 139This exception derives from ``TypeError`` and is raised whenever dtypes140cannot be converted to a single common one.  This can be because they141are of a different category/class or incompatible instances of the same142one (see Examples).143 144Notes145-----146Many functions will use promotion to find the correct result and147implementation.  For these functions the error will typically be chained148with a more specific error indicating that no implementation was found149for the input dtypes.150 151Typically promotion should be considered "invalid" between the dtypes of152two arrays when `arr1 == arr2` can safely return all ``False`` because the153dtypes are fundamentally different.154 155Examples156--------157Datetimes and complex numbers are incompatible classes and cannot be158promoted:159 160>>> import numpy as np161>>> np.result_type(np.dtype("M8[s]"), np.complex128)  # doctest: +IGNORE_EXCEPTION_DETAIL162Traceback (most recent call last):163 ...164DTypePromotionError: The DType <class 'numpy.dtype[datetime64]'> could not165be promoted by <class 'numpy.dtype[complex128]'>. This means that no common166DType exists for the given inputs. For example they cannot be stored in a167single array unless the dtype is `object`. The full list of DTypes is:168(<class 'numpy.dtype[datetime64]'>, <class 'numpy.dtype[complex128]'>)169 170For example for structured dtypes, the structure can mismatch and the171same ``DTypePromotionError`` is given when two structured dtypes with172a mismatch in their number of fields is given:173 174>>> dtype1 = np.dtype([("field1", np.float64), ("field2", np.int64)])175>>> dtype2 = np.dtype([("field1", np.float64)])176>>> np.promote_types(dtype1, dtype2)  # doctest: +IGNORE_EXCEPTION_DETAIL177Traceback (most recent call last):178 ...179DTypePromotionError: field names `('field1', 'field2')` and `('field1',)`180mismatch.181 182rNrrrrrr�s
��-�\	rrN)r�__all__�globals�RuntimeErrorr�RuntimeWarningr�DeprecationWarningr�UserWarningrrr�183ValueError�184IndexErrorr�	TypeErrorrrrr�<module>r:s����D8���7�9��185�@�186A�A�
�187�	�^�	�	�1�	�"	��	�	�.�	�		�<�		�X�188�J�X�v/	�)�/	r
codekingpro/portable-devtools · Team Ai