-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH: Multiple raw instance support to head pos average #12445
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
|
All green, ready from my end @drammock ! |
|
thx @larsoner ! |
| _validate_type(r, BaseRaw, f"raw[{ri}]") | ||
| _validate_type(p, np.ndarray, f"pos[{ri}]") |
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.
the error messages here (which will reference raw[0] or pos[0]) might be slightly confusing for the case where a user passed only 1 raw / pos (not a list). But getting it "right" is pretty convoluted:
item_name = "raw" if len(raw) == 1 else "raw[{}]"
_validate_type(r, BaseRaw, item_name.format(ri))if you can think of a cleaner/simpler way please go for it, otherwise probably fine as-is.
| trans[:3, 3] = dt @ hp[:, 4:7] | ||
| dist = np.linalg.norm(trans[:3, 3]) | ||
| if dist > 1: # less than 1 meter is sane | ||
| warn(f"Implausible head position detected: {dist} meters from device origin") |
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.
tempted to do this but it bumps the line over the length limit
| warn(f"Implausible head position detected: {dist} meters from device origin") | |
| warn(f"Implausible head position detected: {dist:0.3f} meters from device origin") |
|
looks like this got merged while I was reviewing... feel free to ignore my comments (they were very minor / nitpicks anyway) |
|
oups :)
… Message ID: ***@***.***>
|
it's fine, no way you could have known! |
* upstream/main: [pre-commit.ci] pre-commit autoupdate (mne-tools#12453) MAINT: Fix CIs for PyQt6 (mne-tools#12452) DOC: add missing info to interpolate bads docstring (mne-tools#12448) FIX: na_rep for reports (mne-tools#12447) ENH: Multiple raw instance support to head pos average (mne-tools#12445) ENH: Add image_kwargs to report.add_epochs (mne-tools#12443)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Needed for mne-tools/mne-bids-pipeline#574