Call me stupid but I just spent 5 minutes trying to "debug" why this wasn't doing as I expected:
epochs.apply_baseline(None, 0)
Obviously, the baseline period should be specified as a tuple… What happened here is that instead of throwing an error message, I ended up with Epochs without baseline correction. Signature of apply_baseline is:
@verbose
def apply_baseline(self, baseline=(None, 0), verbose=None):
So verbose was simply set to 0.
While you could always argue that of course you should check your results and that you cannot make a software fool-proof, I was still wondering if we couldn't easily prevent some of those "user bugs" from happening. In this particular case, either being more restrictive on the allowed values of verbose, or declaring verbose to be a keyword-only argument would have successfully mitigated my inaptness :)
def apply_baseline(self, baseline=(None, 0), *, verbose=None):
Thoughts?
Call me stupid but I just spent 5 minutes trying to "debug" why this wasn't doing as I expected:
Obviously, the baseline period should be specified as a tuple… What happened here is that instead of throwing an error message, I ended up with Epochs without baseline correction. Signature of
apply_baselineis:So
verbosewas simply set to0.While you could always argue that of course you should check your results and that you cannot make a software fool-proof, I was still wondering if we couldn't easily prevent some of those "user bugs" from happening. In this particular case, either being more restrictive on the allowed values of
verbose, or declaringverboseto be a keyword-only argument would have successfully mitigated my inaptness :)Thoughts?