Skip to content

Commit 0dd8666

Browse files
updating comments of the revision
1 parent b97c792 commit 0dd8666

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ jobs:
311311

312312
- uses: actions/cache@v4
313313
with:
314-
key: testing_data-1-${{ env.TESTING_VERSION }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.mne-version }}
314+
key: testing_data-1-${{ env.TESTING_VERSION }}-${{ matrix.mne-version }}
315315
path: ~/mne_data
316316
name: 'Cache testing data'
317317

mne_bids/tests/test_fileio.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Authors: The MNE-BIDS developers
44
# SPDX-License-Identifier: BSD-3-Clause
55

6+
import importlib
67
import threading
78
import time
89
from concurrent.futures import ProcessPoolExecutor
@@ -11,6 +12,7 @@
1112

1213
import pytest
1314

15+
import mne_bids._fileio
1416
from mne_bids._fileio import (
1517
_canonical_lock_path,
1618
_decrement_and_cleanup_lock_file,
@@ -549,11 +551,6 @@ def test_environment_variable_timeout(tmp_path, monkeypatch):
549551
# We need to reload the module with the env var set
550552
monkeypatch.setenv("MNE_BIDS_FILELOCK_TIMEOUT", "120")
551553

552-
# Import after setting env var
553-
import importlib
554-
555-
import mne_bids._fileio
556-
557554
importlib.reload(mne_bids._fileio)
558555

559556
assert mne_bids._fileio.DEFAULT_LOCK_TIMEOUT == 120.0
@@ -563,11 +560,6 @@ def test_environment_variable_invalid_timeout(tmp_path, monkeypatch):
563560
"""Test DEFAULT_LOCK_TIMEOUT with invalid environment variable."""
564561
monkeypatch.setenv("MNE_BIDS_FILELOCK_TIMEOUT", "invalid")
565562

566-
# Import after setting env var
567-
import importlib
568-
569-
import mne_bids._fileio
570-
571563
importlib.reload(mne_bids._fileio)
572564

573565
# Should fall back to default

mne_bids/tsv_handler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ def _to_tsv(data, fname):
200200
with _open_lock(fname, "w", encoding="utf-8-sig") as f:
201201
f.write(output)
202202
f.write("\n")
203-
f.flush() # Ensure data is written to disk before lock is released
204203

205204

206205
def _tsv_to_str(data, rows=5):

mne_bids/write.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ def _participants_json(fname, overwrite=False):
702702
except json.JSONDecodeError as e:
703703
# File is corrupted/incomplete - this can happen in a race condition
704704
# when one process truncates while another reads
705-
logger.debug(
705+
logger.warning(
706706
f"Could not parse JSON in '{fname}': {e}. "
707707
"This may occur when reading during concurrent writes. "
708708
"Treating as empty."

0 commit comments

Comments
 (0)