Skip to content

Conversation

@GuillaumeFavelier
Copy link
Contributor

@GuillaumeFavelier GuillaumeFavelier commented May 18, 2022

This PR refactors _QtWindow:

  • adds support for custom central layout
  • adds _window_create to spawn a window 'without pyvista support' (instance of _MNEMainWindow)
  • adds the option theme_support to opt-out from automatic theming

and _QtLayout:

  • adds support for grid layout

Here is a code snippet to try:

from mne.viz.backends.renderer import _get_renderer

renderer = _get_renderer()
renderer.show()

window = renderer._window_create()
window.show()

Further consideration:

  • With more refactoring it should be possible to use _get_renderer() to spawn _MNEMainWindow instead of using _PyVistaRenderer. This more important matter is about about having a GUI API which does not depends on pyvista.

It's an item of #10565

@GuillaumeFavelier GuillaumeFavelier self-assigned this May 18, 2022
@larsoner
Copy link
Member

Sounds reasonable, let me know when to look!

@GuillaumeFavelier
Copy link
Contributor Author

This is delayed until #10565 (comment) is resolved.

@larsoner
Copy link
Member

Okay, let me know what PR to review whenever one of them is ready

@GuillaumeFavelier GuillaumeFavelier changed the title WIP,MNT: window and layout in GUI API MNT: window and layout in GUI API May 24, 2022
@GuillaumeFavelier GuillaumeFavelier marked this pull request as ready for review May 24, 2022 10:42
@GuillaumeFavelier
Copy link
Contributor Author

Assuming the CIs return green, this is ready for review @larsoner

@GuillaumeFavelier
Copy link
Contributor Author

The failure on Test Windows 3.9 pip does not seem related:

================================== FAILURES ===================================
________________ test_spatio_temporal_cluster_adjacency[Numba] ________________
mne\stats\tests\test_cluster_level.py:576: in test_spatio_temporal_cluster_adjacency
    spatio_temporal_cluster_test([data1_2d, data2_2d],
<decorator-gen-336>:12: in spatio_temporal_cluster_test
    ???
mne\stats\cluster_level.py:1357: in spatio_temporal_cluster_test
    return permutation_cluster_test(
<decorator-gen-333>:12: in permutation_cluster_test
    ???
mne\stats\cluster_level.py:1123: in permutation_cluster_test
    return _permutation_cluster_test(
mne\stats\cluster_level.py:983: in _permutation_cluster_test
    H0 = parallel(
mne\utils\progressbar.py:157: in __exit__
    os.remove(self._mmap_fname)
E   PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmp_mne_progky0ehjn_'
--------------- generated xml file: D:\a\1\s\junit-results.xml ----------------

@larsoner
Copy link
Member

That looks like a replication of #10648 on CIs, the first time I've seen it! Agreed it's unrelated, though

@larsoner larsoner merged commit 1e806f3 into mne-tools:main May 24, 2022
@larsoner
Copy link
Member

Thanks @GuillaumeFavelier !

@GuillaumeFavelier GuillaumeFavelier deleted the mnt/window branch May 24, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants