-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MRG: _TimeViewer resource guide #7606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MRG: _TimeViewer resource guide #7606
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7606 +/- ##
=======================================
Coverage 90.08% 90.09%
=======================================
Files 454 454
Lines 83551 83568 +17
Branches 13228 13238 +10
=======================================
+ Hits 75266 75287 +21
+ Misses 5420 5418 -2
+ Partials 2865 2863 -2 |
Co-Authored-By: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-Authored-By: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-Authored-By: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-Authored-By: Richard Höchenberger <richard.hoechenberger@gmail.com>
Co-Authored-By: Richard Höchenberger <richard.hoechenberger@gmail.com>
|
Azure seems to take a bit more time. I don't think it's related to this PR. |
I believe it's getting canceled bc the build is taking too long… anyway, LGTM. |
mne/images/README.rst
Outdated
| Patching | ||
| ======== | ||
|
|
||
| The output file imports ``PyQt5`` globally, which is not consistent with MNE core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than all of this, can you nest the import of resources.py wherever it's actually used in the MNE code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try that right now
|
Okay, I think I'll just keep everything in
|
|
That sounds like a nice solution to me Also you have a conflict |
|
Waiting for the CIs to come back happy. Thanks to #7606 (comment) it should be way easier to update the icons. |
Excellent |
|
btw are you planning do add "images" to that directory that would not be some kind of icon? Just asking bc if not, it could make sense to name the directory "icons" instead? |
|
You're right, |
@larsoner Travis fails because of this import during test collection: mne-python/mne/icons/resources.py Line 9 in 934d77f
I tried importing it where it's needed in MNE (in mne-python/mne/viz/_brain/_timeviewer.py Lines 850 to 852 in 934d77f
mne-python/mne/viz/_brain/_timeviewer.py Lines 1095 to 1097 in 934d77f
Do you have an idea? |
|
It will be imported during test collection unless you add it to the ignore list in setup.cfg or maybe mne/conftest.py, it's in one of those |
|
Ignore list, sorry mobile... |
|
Wow, thank you! I was not aware of such a system. |
mne/viz/_brain/_timeviewer.py
Outdated
| def load_icons(self): | ||
| from PyQt5.QtGui import QIcon | ||
| resources.qInitResources() | ||
| from ...icons import resources # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than a noqa and magic init-on-import, I'd leave it closer to how it was and do
from ...icons import resources
resources.qInitResources()
BTW any problem with calling this multiple times (which will happen if you load multiple windows)? If so then a little helper init_resources that inits them exactly once could be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem at all, I tested it with link_brains().
|
Oh I misunderstood: there is no problem calling init multiple times but I still did |
larsoner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please merge once CIs are happy
|
Doing it once or multiple times is fine by me, up to you |
|
It works. I'll merge like this |
This PR adds a small README that describes the instructions to update the
resource.pyfile used for_TimeViewer.