Skip to content

Conversation

@cbrnr
Copy link
Contributor

@cbrnr cbrnr commented Feb 21, 2024

I recently came across a BrainVision file, which contains a channel SpO2 (peripheral oxygen saturation) with a unit %. However, reading this file raises a configparser.InterpolationError, because by default configparser.ConfigParser uses interpolation=configparser.BasicInterpolation (see here). This means that it uses percent-based interpolation, e.g. it replaces %(some_dir) with the value of the variable some_dir (defined elsewhere in the config file).

I am pretty sure that BrainVision header files do not contain such format strings, and therefore, I suggest that we disable interpolation when parsing this file. That way, channels can be specified to have a unit %.

@cbrnr cbrnr force-pushed the brainvision-read-vhdr branch from fbe2201 to 64de235 Compare February 21, 2024 09:46
Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

LGTM

@larsoner
Copy link
Member

Didn't even know interpolation was a thing in ConfigParser, thanks @cbrnr !

@larsoner larsoner merged commit b8ff497 into mne-tools:main Feb 21, 2024
@cbrnr cbrnr deleted the brainvision-read-vhdr branch February 21, 2024 14:30
snwnde pushed a commit to snwnde/mne-python that referenced this pull request Mar 20, 2024
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