ENH : add new interpolate_mark_bads function#9241
Conversation
mne/channels/interpolation.py
Outdated
| origin fit. | ||
| exclude : list | tuple | ||
| The channels to exclude from interpolation. If excluded a bad | ||
| channel will stay bad. |
There was a problem hiding this comment.
I would rather kill this docstring entirely rather than have to continue to update it, I think it actually reduces maintenance burden
mne/channels/channels.py
Outdated
| .. versionadded:: 0.21 | ||
| exclude : list | tuple | ||
| The channels to exclude from interpolation. If excluded a bad | ||
| channel will stay bads. |
There was a problem hiding this comment.
"will stay in bads", or "will stay bad"
mne/preprocessing/interpolate.py
Outdated
| @@ -0,0 +1,64 @@ | |||
| """Tools for interpolation data.""" | |||
There was a problem hiding this comment.
| """Tools for interpolation data.""" | |
| """Tools for data interpolation.""" |
mne/preprocessing/interpolate.py
Outdated
|
|
||
|
|
||
| def interpolate_mark_bads(insts, good_fraction=0., copy=True): | ||
| """Interpolate or mark bads consistently for a list of data. |
There was a problem hiding this comment.
| """Interpolate or mark bads consistently for a list of data. | |
| """Interpolate or mark bads consistently for a list of instances. |
mne/preprocessing/interpolate.py
Outdated
| The list of instances (Evoked, Epochs or Raw) to consider | ||
| for interpolation. Each instance should have marked channels. | ||
| good_fraction : float | ||
| A float between 0 and 1 that specifies the fraction of time |
There was a problem hiding this comment.
| A float between 0 and 1 that specifies the fraction of time | |
| A float between 0 (default) and 1 that specifies the fraction of time |
and then you'll need to re-PEP8-ify it because the line is probably too long
mne/preprocessing/interpolate.py
Outdated
| from ..epochs import BaseEpochs | ||
|
|
||
|
|
||
| def interpolate_mark_bads(insts, good_fraction=0., copy=True): |
There was a problem hiding this comment.
The default I think should be to always just mark all bad (this seemed to be the consensus when we discussed), so good_fraction=1..
mne/preprocessing/interpolate.py
Outdated
| A float between 0 and 1 that specifies the fraction of time | ||
| a channel should be good to be eventually interpolated for | ||
| certain instances. For example if 0.5, a channel which is | ||
| good more than half of the time will be interpolated in the |
There was a problem hiding this comment.
What you wrote here implies > but the conditional below (which operates on the opposite) is <. So the wording here should be changed to reflect the effective >= operation.
| good more than half of the time will be interpolated in the | |
| good at least half of the time will be interpolated in the |
|
why not for equalize_bads
thoughts anyone?
… |
Summer we're talking about API names, WDYT about changing "good_fraction" to something like "interp_thresh"? (Since it's the threshold above which interpolation will happen instead of marking bad) |
|
@drammock +1!! |
|
rename done
… |
|
thanks @agramfort! |
closes #9231