-
Notifications
You must be signed in to change notification settings - Fork 22
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
MNT: Add support for QtPy #104
Conversation
We should also port over the Qt job from MNE-Python https://github.com/mne-tools/mne-python/blob/main/azure-pipelines.yml#L147 |
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.
Looks like a good start so far!
... actually all the CI jobs here are GH actions, so I would just add a new entry in |
|
I pushed a commit that at least made things work for me on PyQt5 again -- On PySide6 I get this ugly error:
It has something to do with the _PGMetaClass stuff, not sure how to fix it :( |
Wow, green! Locally when trying any keyboard shortcut, though, I get things like:
@GuillaumeFavelier I'll stop here for now, feel free to continue when you want :) |
Modifier bugs were present in |
Pushed another little commit to take care of the warnings due to using
|
FYI I need mne-tools/mne-python#10508 for macOS + Python3.10. I'll see if I can replicate on CIs... |
Okay, PySide6, PyQt6, and PyQt5 all work on my macOS system! |
Setting back to WIP because, even though it's getting close, mne-tools/mne-python#10509 should go in first (which should also go in after mne-tools/mne-python#10500) |
times = times[::self.mne.decim_data[self.range_idx]] | ||
data = data[..., ::self.mne.decim_data[self.range_idx]] | ||
else: | ||
times = self.mne.times |
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.
This "caching" of the decimated times was causing problems with tests locally. Creating views (which slicing does) is a 100 ns
-order operation:
In [1]: import numpy as np
In [2]: x = np.random.RandomState(0).randn(10000)
In [3]: %timeit x[100:1111]
136 ns ± 3.88 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
So let's not bother, and instead just slice times at the same time / way as the data
Okay @GuillaumeFavelier I think I'm actually done now :) Feel free to review sometime next week and we can get this in once mne-tools/mne-python#10509 is merged |
@agramfort or @hoechenberger feel free to review and merge if it works for you on PyQt6 and/or PySide6 |
thx @GuillaumeFavelier @larsoner it works like a charm ! |
This PR adds support for
qtpy
.QDesktopWidget
andQApplication.desktop()
are deprecated inQt 5
and removed inQt 6
so I migrated toQScreen
: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktopvtk
,pyqtgraph
checks Qt APIs by trying to import the package directly instead of looking for actual features : https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/Qt/__init__.py#L31-L51To fix this locally, I use the
PYQTGRAPH_QT_LIB
variable.TODO:
Then this PR is ready to go