From 9af75c40ced628aa8496a6ffeef960af69729fac Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Tue, 17 May 2022 08:40:08 +0200 Subject: [PATCH 1/4] Use less memory when loading EDF file --- mne/io/edf/edf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mne/io/edf/edf.py b/mne/io/edf/edf.py index 2487582dc8c..5078d73b8c2 100644 --- a/mne/io/edf/edf.py +++ b/mne/io/edf/edf.py @@ -300,7 +300,8 @@ def _read_segment_file(data, idx, fi, start, stop, raw_extras, filenames, one = np.zeros((len(orig_sel), d_eidx - d_sidx), dtype=data.dtype) for ii, ci in enumerate(read_sel): # This now has size (n_chunks_read, n_samp[ci]) - ch_data = many_chunk[:, ch_offsets[ci]:ch_offsets[ci + 1]] + ch_data = many_chunk[:, + ch_offsets[ci]:ch_offsets[ci + 1]].copy() if ci in tal_idx: tal_data.append(ch_data) From 19a0106094e8dd59eb08e758b2ff592a72a63470 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Tue, 17 May 2022 13:38:15 +0200 Subject: [PATCH 2/4] Add changelog entry --- doc/changes/latest.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changes/latest.inc b/doc/changes/latest.inc index 2c3efb613d7..0256b71a9c8 100644 --- a/doc/changes/latest.inc +++ b/doc/changes/latest.inc @@ -100,6 +100,8 @@ Bugs - Fix bug in :func:`mne.viz.plot_evoked_image` that would cause incorrect sub-titles when using ``group_by`` (:gh:`10618` by `Reza Shoorangiz`_) +- Reduce memory usage when loading an EDF file with `preload=False` (:gh:`10638` by `Clemens Brunner`_) + API and behavior changes ~~~~~~~~~~~~~~~~~~~~~~~~ - When creating BEM surfaces via :func:`mne.bem.make_watershed_bem` and :func:`mne.bem.make_flash_bem`, the ``copy`` parameter now defaults to ``True``. This means that instead of creating symbolic links inside the FreeSurfer subject's ``bem`` folder, we now create "actual" files. This should avoid troubles when sharing files across different operating systems and file systems (:gh:`10531` by `Richard Höchenberger`_) From b622e68ce4c9c5baf118ee0405ed4870e3c104e3 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Tue, 17 May 2022 15:17:43 +0200 Subject: [PATCH 3/4] Formatting Co-authored-by: Alexandre Gramfort --- doc/changes/latest.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/latest.inc b/doc/changes/latest.inc index 0256b71a9c8..ae103f5dc49 100644 --- a/doc/changes/latest.inc +++ b/doc/changes/latest.inc @@ -100,7 +100,7 @@ Bugs - Fix bug in :func:`mne.viz.plot_evoked_image` that would cause incorrect sub-titles when using ``group_by`` (:gh:`10618` by `Reza Shoorangiz`_) -- Reduce memory usage when loading an EDF file with `preload=False` (:gh:`10638` by `Clemens Brunner`_) +- Reduce memory usage when loading an EDF file with ``preload=False`` (:gh:`10638` by `Clemens Brunner`_) API and behavior changes ~~~~~~~~~~~~~~~~~~~~~~~~ From 67ec93e8b8c8d6eede42b4edb8a34cc7bbb796a9 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Tue, 17 May 2022 17:00:54 +0200 Subject: [PATCH 4/4] Restart CI