示例#1
0
def _SciPyIssue(x, *extras):  # PYCHOK no cover
    t = map(str, extras) if extras else []
    t = _SPACE_.join(str(x).strip().split() + t)
    if isinstance(x, (RuntimeWarning, UserWarning)):
        X = SciPyWarning
    else:
        X = SciPyError  # PYCHOK not really
    return _error_chain(X(t), other=x)
示例#2
0
 def _en(en, lo, hi, ename):  # U, Error
     try:
         if lo <= float(en) <= hi:
             return
     except (TypeError, ValueError):
         pass
     t = _SPACE_.join(
         (_outside_, U, _range_, '[%.0F' % (lo, ), '%.0F]' % (hi, )))
     raise Error(ename, en, txt=t)
示例#3
0
def _incompatible(this):
    '''(INTERNAL) Format an incompatible text.
    '''
    return _SPACE_.join(('incompatible', 'with', str(this)))