mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
decorator documentation
This commit is contained in:
parent
5781fbd582
commit
78f7414642
1 changed files with 5 additions and 0 deletions
|
|
@ -2,6 +2,11 @@ import numpy as np
|
|||
from functools import wraps
|
||||
|
||||
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)
|
||||
def wrapper(*args, **kwds):
|
||||
status = np.seterr(all='ignore')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue