Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Reading an EDF with preload=False and mixed frequency #13069

Merged
merged 6 commits into from
Jan 17, 2025

Conversation

skjerns
Copy link
Contributor

@skjerns skjerns commented Jan 17, 2025

Fixes #12897.

When loading an EDF with mixed sample frequencies and using preload=False and then requesting a channel that has lower sample frequency than the maximum resulted in an AssertionError.

What does this implement/fix?

This Assertion was in place to make sure that enough samples were read, but only made sense when one of the channels of maximum sample frequency was loaded.

It can simply be removed as I don't think that the case can actually occur. Additionally, there is another check for zeros a few lines later that serves a similar purpose.

@larsoner
Copy link
Member

I know it unrelated, but to get things green could you add Starting field name with a underscore as another ignore to

ignore:numpy\.core\.records is deprecated.*:DeprecationWarning

?

@larsoner
Copy link
Member

Never mind I pushed... marking for merge-when-green, thanks in advance @skjerns !

@larsoner larsoner enabled auto-merge (squash) January 17, 2025 20:11
@larsoner larsoner disabled auto-merge January 17, 2025 21:38
@larsoner larsoner merged commit bd8c318 into mne-tools:main Jan 17, 2025
28 of 30 checks passed
qian-chu pushed a commit to qian-chu/mne-python that referenced this pull request Jan 20, 2025
…s#13069)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Larson <[email protected]>
larsoner added a commit to larsoner/mne-python that referenced this pull request Jan 24, 2025
* upstream/main: (57 commits)
  Allow lasso selection sensors in a plot_evoked_topo (mne-tools#12071)
  MAINT: Fix doc build (mne-tools#13076)
  BUG: Improve sklearn compliance (mne-tools#13065)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13073)
  MAINT: Add Numba to 3.13 test (mne-tools#13075)
  Bump autofix-ci/action from ff86a557419858bb967097bfc916833f5647fa8c to 551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef in the actions group (mne-tools#13071)
  [BUG] Correct annotation onset for exportation to EDF and EEGLAB (mne-tools#12656)
  New feature for removing heart artifacts from EEG or ESG data using a Principal Component Analysis - Optimal Basis Sets (PCA-OBS) algorithm (mne-tools#13037)
  [BUG] Fix taper weighting in computation of TFR multitaper power (mne-tools#13067)
  [FIX] Reading an EDF with preload=False and mixed frequency (mne-tools#13069)
  Fix evoked topomap colorbars, closes mne-tools#13050 (mne-tools#13063)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13060)
  BUG: Fix bug with interval calculation (mne-tools#13062)
  [DOC] extend documentation for add_channels (mne-tools#13051)
  Add `combine_tfr` to API (mne-tools#13054)
  Add `combine_spectrum()` function and allow `grand_average()` to support `Spectrum` data (mne-tools#13058)
  BUG: Fix bug with helium anon (mne-tools#13056)
  [ENH] Add option to store and return TFR taper weights (mne-tools#12910)
  BUG: viz plot window's 'title' argument showed no effect. (mne-tools#12828)
  MAINT: Ensure limited set of tests are skipped (mne-tools#13053)
  ...
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.

Error when reading an EDF file (resampling)
2 participants