mne-tools / mne-tools/mne-python
Reconsider viz.plot_ica_overlay()'s treatment of start, stop parameters
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
After seeing https://mne.discourse.group/t/ica-plot-overlay-pan-forward-and-missing-data/2781?u=richard, I played a little with viz.plot_ica_overlay() and Raw data.
Turns out that the start and stop parameters are not fully and properly documented; and more unexpectedly, lead to different behaviors depending on whether you pass an interger or a float.
If you pass an integer, it's interpreted as a time index; if you pass a float, it's a time point in seconds.
The current docs only say:
start : int
X-axis start index. If None from the beginning.
stop : int
X-axis stop index. If None to the end.
which I believe is very technical and doesn't fully document the behavior. The actual behavior (treating ints and floats differently) was very unexpected to me, being a long-time MNE user.
So it made me wonder, would anyone even make use of the "passing time as an index" functionality these days? I'm used to passing times as seconds or fractions of seconds in MNE, and I've never had to even think about casting an integer time to a float to get the expected behavior.
My proposal is to deprecate this differentiation, and eventually remove support for "time as index" from viz.plot_ica_overlay(), keeping only "time in seconds" functionality.
WDYT?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with viz.plot_ica_overlay() and its parameter documentation, then compare the documented start/stop handling with the integer-versus-float behavior described here. Determine whether index support should be deprecated and removed in favor of seconds; completion requires a decided API direction and documentation that accurately describes the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100