Skip to content

[ENH, MRG] Add info save method - #11401

Merged
drammock merged 5 commits into
mne-tools:mainfrom
alexrockhill:save
Jan 3, 2023
Merged

drammock merged 5 commits into
mne-tools:mainfrom
alexrockhill:save

Conversation

@alexrockhill

Copy link
Copy Markdown
Contributor

Adds a save method to the info class in addition to mne.io.write_info for convenience.

Comment thread mne/io/meas_info.py Outdated
Comment on lines +1237 to +1242
data_type : int
The data_type in case it is necessary. Should be 4 (FIFFT_FLOAT),
5 (FIFFT_DOUBLE), or 16 (FIFFT_DAU_PACK16) for
raw data.
reset_range : bool
If True, info['chs'][k]['range'] will be set to unity.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we avoid exposing these? I'd rather add them later if someone needs them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is copied from mne.io.write_info, do you want to remove it there too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No we need it there for completeness. Stuff in mne.io.* was added quite early and not with a user API in mind. This PR is a chance for us to make a nice API from the start

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good

Comment thread mne/io/meas_info.py Outdated
Parameters
----------
fname : str
The name of the file. Should end by -info.fif.

@hoechenberger hoechenberger Jan 2, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
The name of the file. Should end by -info.fif.
The name of the file. Should end by ``-info.fif``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Edited your comment to have double backticks (rst vs md code mode)

@drammock
drammock merged commit ea88c55 into mne-tools:main Jan 3, 2023
@drammock

drammock commented Jan 3, 2023

Copy link
Copy Markdown
Member

thanks @alexrockhill

@alexrockhill
alexrockhill deleted the save branch January 3, 2023 19:21
larsoner added a commit to larsoner/mne-python that referenced this pull request Jan 3, 2023
* upstream/main:
  [ENH, MRG] Add info save method (mne-tools#11401)
  MAINT: Sanitize name lists (mne-tools#11399)
  [ENH] Read annotation duration from SNIRF files. (mne-tools#11397)
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.

5 participants