Merge branch 'master' of github.com:SheffieldML/GPy

This commit is contained in:
Nicolas 2013-03-12 16:50:24 +00:00
commit e25ce2a294

View file

@ -2,6 +2,11 @@ import numpy as np
from functools import wraps from functools import wraps
def silence_errors(f): def silence_errors(f):
"""
This wraps a function and it silences numpy errors that
happen during the execution. After the function has exited, it restores
the previous state of the warnings.
"""
@wraps(f) @wraps(f)
def wrapper(*args, **kwds): def wrapper(*args, **kwds):
status = np.seterr(all='ignore') status = np.seterr(all='ignore')