Skip to content

Conversation

@papadop
Copy link
Contributor

@papadop papadop commented Jun 1, 2025

Reference issue (if any)

Fixes #13257.

What does this implement/fix?

See issue, but in two words file_id is not read correctly when the file contains a directory at the end of the file.

Additional information

The effect can be seen when reading sample_audvis_filt-0-40_raw.fif which contains such a directory.

@papadop
Copy link
Contributor Author

papadop commented Jun 2, 2025

Strangely something has changed in my environment and I cannot reproduce the bug as it was reported. Yet the code was surely never loading the last tag, which is strange. I think the proposed implementation is more exact. So I changed the title and will change the ChangeLog (but I first wait for tests to pass).

@papadop papadop changed the title Do not ignore the file_id. Tidy up the directory reading Jun 2, 2025
pos = tag.pos + 16
entries = list()
for offset in range(1, tag.size // 16):
for offset in range(tag.size // 16):
Copy link
Member

Choose a reason for hiding this comment

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

Looking at this for example I think this is probably correct

https://github.com/mne-tools/mne-cpp/blob/16a9381834d2c81269a553e0a1af7af752393006/src/libraries/fiff/fiff_tag.cpp#L565

So I'll go ahead and merge. Thanks @papadop !

@larsoner larsoner merged commit ecc3375 into mne-tools:main Jun 2, 2025
1 of 3 checks passed
larsoner added a commit to larsoner/mne-python that referenced this pull request Jun 26, 2025
* upstream/main: (55 commits)
  doc: fix rendering typo rst docstr (mne-tools#13301)
  DOC: fix docstrs around layout functions (mne-tools#13300)
  MAINT: Fix doc build failure due to deprecation (mne-tools#13299)
  Birthday input cast to datetime.date (mne-tools#13284)
  DOC: fix missing space, use f-strings, structure->object (mne-tools#13291)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13290)
  ENH: channel_indices_by_type now has an exclude param (mne-tools#13293)
  Proj id and proj name access (mne-tools#13261)
  Fix: nearly invisible traces with spatial_colors=True (mne-tools#13286)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13283)
  Bump autofix-ci/action from 551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef to 635ffb0c9798bd160680f18fd73371e355b85f27 in the actions group (mne-tools#13282)
  fix Maxwell bads filtering (mne-tools#13280)
  fix actionable linkcheck errors (mne-tools#13273)
  MAINT: Use radius keyword with PyVista tube (mne-tools#13277)
  BUG: Fix bug with simulating head pos and BEM (mne-tools#13276)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13274)
  MAINT: Update code credit (mne-tools#13267)
  Annotations extras (mne-tools#13228)
  Tidy up the directory reading (mne-tools#13268)
  FIX, DOC: Drop bad channel in 10_publication_figure.py (mne-tools#13266)
  ...
zEdS15B3GCwq pushed a commit to zEdS15B3GCwq/mne-python that referenced this pull request Aug 25, 2025
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.

info['file_id'] not set properly when there is a directory

2 participants