Skip to content

Improve docs for raw.to_data_frame#13590

Merged
drammock merged 7 commits intomne-tools:mainfrom
1himan:mne-python-raw.to_data_frame-docImprove
Jan 28, 2026
Merged

Improve docs for raw.to_data_frame#13590
drammock merged 7 commits intomne-tools:mainfrom
1himan:mne-python-raw.to_data_frame-docImprove

Conversation

@1himan
Copy link
Contributor

@1himan 1himan commented Jan 14, 2026

Reference issue (if any)

Fixes #12701

What does this implement/fix?

Additional information

Just a minor improvement for more clarity in the documentation.
An added notes section under raw.to_data_frame(), explicitly explaining the default behaviour of that api, which is to convert the data to SI units before returning it by default.

@1himan
Copy link
Contributor Author

1himan commented Jan 14, 2026

Do I have to describe the changes in the changelog as well, for such a minor change?

@tsbinns
Copy link
Contributor

tsbinns commented Jan 14, 2026

I would argue the unit conversion behaviour is already described in the scalings parameter description of to_data_frame.

Also, the note has it the wrong way around: data is stored internally in standard (SI) units (e.g., V for EEG data), but what the method returns is the data scaled into a more appropriate range (e.g., uV for EEG data).

@1himan
Copy link
Contributor Author

1himan commented Jan 17, 2026

I would argue the unit conversion behaviour is already described in the scalings parameter description of to_data_frame.

Also, the note has it the wrong way around: data is stored internally in standard (SI) units (e.g., V for EEG data), but what the method returns is the data scaled into a more appropriate range (e.g., uV for EEG data).

You're right. after reading more on this, I found out that this method doesn't do any "conversions" on data at all, rather it returns the data(picked channels) with scaling factors applied(default behaviour - scalings=None) which is useful for plotting.

@1himan
Copy link
Contributor Author

1himan commented Jan 21, 2026

I don't think, changelog should be updated here, that'd be just noise? @drammock.

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides the 1 comment below, I'd agree that docstring fixes don't necessarily need a changelog entry (sometimes we do, if the docstring changed to match the behavior, and they were originally quite different... but here I think it's more of a refinement rather than a big change so I'm OK with no changelog entry)

@1himan
Copy link
Contributor Author

1himan commented Jan 28, 2026

And now the docs looks something like this:
image

@drammock drammock merged commit 1801e86 into mne-tools:main Jan 28, 2026
1 of 2 checks passed
@drammock
Copy link
Member

thanks @1himan !

larsoner added a commit to teonbrooks/mne-python that referenced this pull request Jan 30, 2026
* upstream/main: (23 commits)
  DOC: Add jupyterlite idea to roadmap (mne-tools#13620)
  MAINT: Use f-strings in test_import_nesting.py (mne-tools#13551)
  Improve docs for raw.to_data_frame (mne-tools#13590)
  Sensitivity map doc improved (mne-tools#13578)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13612)
  MAINT: Fix for latest SciPy (mne-tools#13613)
  Fix pre-commit call in SPEC0 action [ci skip] (mne-tools#13609)
  MAINT: Add mne-denoise to CI dependencies (mne-tools#13607)
  FIX: do not cache canvas object (mne-tools#13606)
  FIX: Set calibration plot axes to screen resolution if available (mne-tools#13558)
  Refactoring eyetracking.py (mne-tools#13602)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13601)
  Follow up PR to PR - mne-tools#13596 (mne-tools#13599)
  FIX: Sphinx (mne-tools#13600)
  Doc improvement - Examples using <some-method> section quirk fix (mne-tools#13596)
  Add more information to eSSS in examples and docsstring (mne-tools#13591)
  np.fix -> np.trunc (deprecation) (mne-tools#13594)
  Make mne.sys_info() work with powershell 7+ (mne-tools#13593)
  BUG: Fix minor bug with T1 check (mne-tools#13588)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13587)
  ...
larsoner added a commit to contsili/mne-python that referenced this pull request Jan 30, 2026
* upstream/main: (67 commits)
  DOC: Add jupyterlite idea to roadmap (mne-tools#13620)
  MAINT: Use f-strings in test_import_nesting.py (mne-tools#13551)
  Improve docs for raw.to_data_frame (mne-tools#13590)
  Sensitivity map doc improved (mne-tools#13578)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13612)
  MAINT: Fix for latest SciPy (mne-tools#13613)
  Fix pre-commit call in SPEC0 action [ci skip] (mne-tools#13609)
  MAINT: Add mne-denoise to CI dependencies (mne-tools#13607)
  FIX: do not cache canvas object (mne-tools#13606)
  FIX: Set calibration plot axes to screen resolution if available (mne-tools#13558)
  Refactoring eyetracking.py (mne-tools#13602)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13601)
  Follow up PR to PR - mne-tools#13596 (mne-tools#13599)
  FIX: Sphinx (mne-tools#13600)
  Doc improvement - Examples using <some-method> section quirk fix (mne-tools#13596)
  Add more information to eSSS in examples and docsstring (mne-tools#13591)
  np.fix -> np.trunc (deprecation) (mne-tools#13594)
  Make mne.sys_info() work with powershell 7+ (mne-tools#13593)
  BUG: Fix minor bug with T1 check (mne-tools#13588)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13587)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default units in raw.to_data_frame()

3 participants