Skip to content

Conversation

@larsoner
Copy link
Member

@larsoner larsoner changed the title ENH: Multiple raw instance support head pos average ENH: Multiple raw instance support to head pos average Feb 16, 2024
@larsoner
Copy link
Member Author

All green, ready from my end @drammock !

@agramfort agramfort merged commit 49e895f into mne-tools:main Feb 16, 2024
@agramfort agramfort deleted the average branch February 16, 2024 20:24
@agramfort
Copy link
Member

thx @larsoner !

Comment on lines +337 to +338
_validate_type(r, BaseRaw, f"raw[{ri}]")
_validate_type(p, np.ndarray, f"pos[{ri}]")
Copy link
Member

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")
Copy link
Member

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

Suggested change
warn(f"Implausible head position detected: {dist} meters from device origin")
warn(f"Implausible head position detected: {dist:0.3f} meters from device origin")

@drammock
Copy link
Member

looks like this got merged while I was reviewing... feel free to ignore my comments (they were very minor / nitpicks anyway)

@agramfort
Copy link
Member

agramfort commented Feb 16, 2024 via email

@drammock
Copy link
Member

oups :)

it's fine, no way you could have known!

larsoner added a commit to SophieHerbst/mne-python that referenced this pull request Feb 20, 2024
* 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)
snwnde pushed a commit to snwnde/mne-python that referenced this pull request Mar 20, 2024
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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.

3 participants