-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ENH: button to save movie #9190
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
Conversation
Now i get it! The Notebook job actually skips the notebook test 😅
|
The mne-python/mne/viz/_brain/_brain.py Lines 3045 to 3109 in 874e8e1
|
I removed the strange and untested use case where no filename is given considering that there are so many ways to input a Also this is how it looks for me with the output.mp4I'll try to fix the notebook CI and double-check the status bar layout. |
When I create
|
Found it, it probably comes from Lines 341 to 342 in d711b14
|
This time it passed:
|
The layout is fixed after 6b6f5d6. I also set the attributes of the status bar and dock to private. It's now ready for reviews @agramfort, @larsoner |
Pushed a hotfix related to |
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 need to update the test.ipynb
? A quick look suggests there is no save_movie
called in there, so we must be relying on the button press to get us there.
It's probably worthwhile to make a _TempDir
, and monkey-patch _get_default_file_name
to write to some known file like that op.join(tempdir, 'test.png')
then assert op.isfile(fname)
after clicking all the buttons. Or maybe simpler, figure out how to modify the "screenshot path" widget with this path before clicking all buttons. This text is about screenshots but the same could apply to movies (somehow). WDYT? To me the updated testing infrastructure is important...
mne/viz/_brain/_brain.py
Outdated
self._renderer.screenshot(mode=mode, filename=filename) | ||
default_name = _generate_default_filename(".png") | ||
filename = default_name if filename is None else filename | ||
from ..utils import _save_ndarray_img |
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.
does not need to be nested
mne/viz/_brain/_brain.py
Outdated
default_name = _generate_default_filename(".png") | ||
filename = default_name if filename is None else filename |
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.
default_name = _generate_default_filename(".png") | |
filename = default_name if filename is None else filename | |
if filename is None: | |
filename = _generate_default_filename(".png") |
filename = default_name if filename is None else filename | ||
from ..utils import _save_ndarray_img | ||
_save_ndarray_img( | ||
filename, self.screenshot(mode=mode, time_viewer=True)) |
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.
Do we even need a time_viewer
op.tion in screenshot
anymore? Nothing changes with the 3D rendering with this anymore because all controls are in Qt or ipywidgets, right?
But we probably should add a show_traces
argument. But both of these could be in a quick follow-up PR I think.
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.
You're right, I don't think this parameter is necessary anymore in here
Indeed, it is done in :
From: mne-python/mne/viz/_brain/tests/test.ipynb Lines 68 to 71 in e273cac
I'm on it. |
I updated
|
I think it's ready now |
Actually, I can wait for #9034 and update accordingly. |
The GitHub Actions jobs fail with:
during the https://github.com/mne-tools/mne-python/runs/2285850191?check_suite_focus=true#step:5:308 It seems related to: mne-python/tools/get_minimal_commands.sh Line 24 in d0f71e5
Or: mne-python/tools/get_minimal_commands.sh Line 46 in d0f71e5
But I still have to confirm it. |
Locally I was able to reproduce:
There seem to be something wrong with this link. My web browser cannot process it either: |
It was only a temporary issue, probably server overload or something 🤔 I restarted the failing jobs. |
Thanks @GuillaumeFavelier |
This PR adds a button to
save_movie
for thenotebook
3d backend.ToDo:
save_movie
and removePyQt5
dependency (ENH: button to save movie #9190 (comment))It's an item of #8704