Heray-Was-Here
Server : Apache
System : Linux vps43555.mylogin.co 3.10.0-1160.53.1.vz7.185.3 #1 SMP Tue Jan 25 12:49:12 MSK 2022 x86_64
User : redsea ( 60651)
PHP Version : 7.4.32
Disable Function : NONE
Directory :  /proc/3/task/3/root/hosting/proc/self/root/lib64/python2.7/site-packages/numpy/numarray/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/3/task/3/root/hosting/proc/self/root/lib64/python2.7/site-packages/numpy/numarray/util.py
import os
import numpy as np

__all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError',
           'handleError', 'get_numarray_include_dirs']

class MathDomainError(ArithmeticError):
    pass


class UnderflowError(ArithmeticError):
    pass


class NumOverflowError(OverflowError, ArithmeticError):
    pass


def handleError(errorStatus, sourcemsg):
    """Take error status and use error mode to handle it."""
    modes = np.geterr()
    if errorStatus & np.FPE_INVALID:
        if modes['invalid'] == "warn":
            print "Warning: Encountered invalid numeric result(s)", sourcemsg
        if modes['invalid'] == "raise":
            raise MathDomainError(sourcemsg)
    if errorStatus & np.FPE_DIVIDEBYZERO:
        if modes['dividebyzero'] == "warn":
            print "Warning: Encountered divide by zero(s)", sourcemsg
        if modes['dividebyzero'] == "raise":
            raise ZeroDivisionError(sourcemsg)
    if errorStatus & np.FPE_OVERFLOW:
        if modes['overflow'] == "warn":
            print "Warning: Encountered overflow(s)", sourcemsg
        if modes['overflow'] == "raise":
            raise NumOverflowError(sourcemsg)
    if errorStatus & np.FPE_UNDERFLOW:
        if modes['underflow'] == "warn":
            print "Warning: Encountered underflow(s)", sourcemsg
        if modes['underflow'] == "raise":
            raise UnderflowError(sourcemsg)


def get_numarray_include_dirs():
    base = os.path.dirname(np.__file__)
    newdirs = [os.path.join(base, 'numarray', 'include')]
    return newdirs

Hry