mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
added decorator to silence errors
This commit is contained in:
parent
21c3988a21
commit
1dc6ee574b
2 changed files with 11 additions and 0 deletions
|
|
@ -10,3 +10,4 @@ import Tango
|
|||
import misc
|
||||
import warping_functions
|
||||
import datasets
|
||||
import decorators
|
||||
|
|
|
|||
10
GPy/util/decorators.py
Normal file
10
GPy/util/decorators.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import numpy as np
|
||||
from functools import wraps
|
||||
|
||||
def silence_errors(f):
|
||||
status = np.seterr(all='ignore')
|
||||
@wraps(f)
|
||||
def wrapper(*args, **kwds):
|
||||
return f(*args, **kwds)
|
||||
np.seterr(**status)
|
||||
return wrapper
|
||||
Loading…
Add table
Add a link
Reference in a new issue