Skip to content

MRG: Split _timeviewer.py into multiple files - #8181

Merged
larsoner merged 3 commits into
mne-tools:masterfrom
GuillaumeFavelier:split_timeviewer_file
Sep 1, 2020
Merged

larsoner merged 3 commits into
mne-tools:masterfrom
GuillaumeFavelier:split_timeviewer_file

Conversation

@GuillaumeFavelier

Copy link
Copy Markdown
Contributor

_timeviewer.py is getting big, around 1500 lines on master and will probably continue to grow as more features are added.

This PR moves some classes in their own files and keep the main _TimeViewer class:

  • MplCanvas which manages matplotlib integration as a QWidget
  • the viewer callbacks (ShowView, IntSlider, TimeSlider, SmartSlider, BumpColorbarPoints, UpdateColorbarScale)
  • _LinkViewer which synchronize multiple instances of _TimeViewer

It's only refactoring but it may help with #7959

@GuillaumeFavelier GuillaumeFavelier changed the title Split _timeviewer.py into multiple files MRG: Split _timeviewer.py into multiple files Sep 1, 2020
@GuillaumeFavelier

Copy link
Copy Markdown
Contributor Author

This is ready for reviews @agramfort, @larsoner

@agramfort agramfort left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larsoner merge if happy

@larsoner

larsoner commented Sep 1, 2020

Copy link
Copy Markdown
Member

@GuillaumeFavelier codecov gave some inline comments (awesome!), do you want to take a few minutes to see if you can hit a few of them?

@GuillaumeFavelier

Copy link
Copy Markdown
Contributor Author

Yes, I'll see what I can do :)

@GuillaumeFavelier GuillaumeFavelier changed the title MRG: Split _timeviewer.py into multiple files WIP: Split _timeviewer.py into multiple files Sep 1, 2020
@GuillaumeFavelier

Copy link
Copy Markdown
Contributor Author

Locally I missed some lines related to matplotlib events in mplcanvas.py.

@GuillaumeFavelier GuillaumeFavelier changed the title WIP: Split _timeviewer.py into multiple files MRG: Split _timeviewer.py into multiple files Sep 1, 2020
@larsoner

larsoner commented Sep 1, 2020

Copy link
Copy Markdown
Member

These can be difficult to hit, but we do have _fake_click you could use. But we can save that for another PR

@larsoner

larsoner commented Sep 1, 2020

Copy link
Copy Markdown
Member

(or you can just manually call the callbacks yourself if you want, since we probably have access to them)

@larsoner
larsoner merged commit 0d88b2e into mne-tools:master Sep 1, 2020
@larsoner

larsoner commented Sep 1, 2020

Copy link
Copy Markdown
Member

Thanks @GuillaumeFavelier

@GuillaumeFavelier
GuillaumeFavelier deleted the split_timeviewer_file branch September 2, 2020 07:59
larsoner added a commit to hubertjb/mne-python that referenced this pull request Sep 2, 2020
…ysionet

* upstream/master:
  ENH: Add message (mne-tools#8193)
  ENH: Allow writing BEM in H5 format (mne-tools#8191)
  ENH: Add ori on MRI slices (mne-tools#8188)
  Ricoh new files (mne-tools#8187)
  MRG: Split _timeviewer.py into multiple files (mne-tools#8181)
  ENH: Better memory efficiency (mne-tools#8185)
  MRG: Trimming Sleep Physionet recordings to avoid W imbalance (mne-tools#8179)
  MRG, BUG: Fix montage plotting, deduplication, and preload check (mne-tools#8178)
  Test PSD topomap works with NIRS epochs (mne-tools#8180)
  MRG, MAINT: Tweak CI versions (mne-tools#8174)
marsipu pushed a commit to marsipu/mne-python that referenced this pull request Oct 14, 2020
* Split into multiple files

* Improve coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants