-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow int-like as ID of make_fixed_length_events #11748
Conversation
@@ -957,7 +957,7 @@ def make_fixed_length_events( | |||
from .io.base import BaseRaw | |||
|
|||
_validate_type(raw, BaseRaw, "raw") | |||
_validate_type(id, int, "id") | |||
_validate_type(id, "int", "id") |
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.
Another version is id = _ensure_int(...)
. It's slightly preferred because it always returns a python int but either way is fine here 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.
Should be correctly handled by numpy here id * np.ones(n_events, dtype=int)
in this case
Pip pre failure looks unrelated and probably due to a Qt update. I'll look in a couple of hours |
CIs just needed a restart, thanks @mscheltienne ! |
* upstream/main: (24 commits) Allow int-like as ID of make_fixed_length_events (mne-tools#11748) Easycap-M43 montage (mne-tools#11744) ENH: Create a Calibrations class for eyetracking data (mne-tools#11719) Fix alphabetical order in overview/people.rst, fix sphinx formatting in docstrings and set verbose to keyword-only (mne-tools#11745) Add Mathieu Scheltienne to MNE-Python Steering Council (mne-tools#11741) removed requirement for curv.*h files to create Brain object (mne-tools#11704) [BUG] Fix mne.viz.Brain.add_volume_labels matrix ordering bug (mne-tools#11730) Fix installer links (mne-tools#11729) MAINT: Update for PyVista deprecation (mne-tools#11727) MAINT: Update roadmap (mne-tools#11724) MAINT: Update download link [skip azp] [skip cirrus] [skip actions] fix case for chpi_info[1] == None (mne-tools#11714) Add cmap argument for mne.viz.utils.plot_sensors (mne-tools#11720) BUG: Fix one more PySide6 bug (mne-tools#11723) MAINT: Fix PySide6 and PyVista compat (mne-tools#11721) MRG: If _check_fname() cannot find a file, display the path in quotation marks to help spot accidental trailing spaces (mne-tools#11718) Add "array-like" to `_validate_type()` (mne-tools#11713) MAINT: Avoid problematic PySide6 (mne-tools#11715) Fix installer links (mne-tools#11709) Updating change log after PR mne-tools#11575 (mne-tools#11707) ...
This function was raising when an ID
np.int64
retrieved from the event array returned bymne.find_events
was used.