fromfigaro.transformimporttransform_from_probit,transform_to_probit"""A gentle introduction to decorators: https://towardsdatascience.com/how-to-use-decorators-in-python-by-example-b398328163b"""
[docs]defantiprobit(func):""" Transform a point x from probit space to natural space and returns the function evaluated at the natural point y """deff_transf(ref,x,*args,**kwargs):ifnotref.probit:returnfunc(ref,x,*args,**kwargs)y=transform_from_probit(x,ref.bounds)returnfunc(ref,y,*args,**kwargs)returnf_transf
[docs]defprobit(func):""" Transform a point x from natural space to probit space and returns the function evaluated at the probit point y """deff_transf(ref,x,*args,**kwargs):ifnotref.probit:returnfunc(ref,x,*args,**kwargs)y=transform_to_probit(x,ref.bounds)returnfunc(ref,y,*args,**kwargs)returnf_transf
[docs]deffrom_probit(func):""" Evaluate a function that samples points in probit space and return these points after transforming them to natural space """deff_transf(ref,*args,**kwargs):ifnotref.probit:returnfunc(ref,*args,**kwargs)y=func(ref,*args,**kwargs)returntransform_from_probit(y,ref.bounds)returnf_transf