Open MatthieuSchaller opened 1 month ago
I don't like overloading the return values of a function based on an input parameter. But i am more than happy for you to write a predict_values_no_error() or similarly named function. You would need to add it to the abstract base class in base.py and then add corresponding versions to all of the associated classes in emulators/
. It shouldn't be too bad.
Ok. I agree that having different numbers of outputs based on arguments is not great but seems common in the python world.
A separate function will work too. I'll do that.
Could we add an optional parameter to
GaussianProcessEmulator.predict_values()
which would switch on/off the computation of the variance? That would "just" require to passreturn_var=False
to the george GP object.In my use case, returning the variance is 50x slower (60ms vs. 1.2ms) than not returning it. In an emulation MCMC scenario where the PS baryon ratio is just a small component, that is a critical difference.
Getting the full error is only necessary once the chain has converged and then switching on the variance return would suffice.
Happy to have a stab at it.