Skip to content

Conversation

@drammock
Copy link
Member

PR Description

  • fixup a couple missed bits from [MRG] Add motion to BIDSPath #1430
  • fix the output formatting in the doctest for event_file_to_annotation_kwargs
  • make sure when we read TSV files, the column names end up as builtin str class (not np.str_)

Merge checklist

Maintainer, please confirm the following before merging.
If applicable:

  • All comments are resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • New contributors have been added to CITATION.cff
  • PR description includes phrase "closes <#issue-number>"

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.89%. Comparing base (1e0a96e) to head (0598c07).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1478      +/-   ##
==========================================
- Coverage   96.94%   96.89%   -0.05%     
==========================================
  Files          43       43              
  Lines       10077    10079       +2     
==========================================
- Hits         9769     9766       -3     
- Misses        308      313       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

changes LGTM

@drammock drammock mentioned this pull request Nov 11, 2025
7 tasks
@larsoner
Copy link
Member

CIs unhappy. Pushed a little commit to get things further on my system where it still fails with NumPy-related stuff (a few newlines added by me for readability)

$ pytest --doctest-modules mne_bids/read.py
=============================================================================== test session starts ================================================================================
platform linux -- Python 3.13.7, pytest-8.3.5, pluggy-1.6.0
PySide6 6.10.0 -- Qt runtime 6.10.0 -- Qt compiled 6.10.0
rootdir: /home/larsoner/python/mne-bids
configfile: pyproject.toml
plugins: dependency-0.6.0, anyio-4.9.0, cov-6.1.1, qt-4.4.0, rerunfailures-16.1, timeout-2.4.0
collected 1 item                                                                                                                                                                   

mne_bids/read.py F                                                                                                                                                           [100%]

===================================================================================== FAILURES =====================================================================================
_____________________________________________________________ [doctest] mne_bids.read.events_file_to_annotation_kwargs _____________________________________________________________
606 >>>
607 >>> # Write the DataFrame to a temporary file
608 >>> temp_dir = tempfile.gettempdir()
609 >>> events_file = Path(temp_dir) / 'events.tsv'
610 >>> df.to_csv(events_file, sep='\t', index=False)
611 >>>
612 >>> # Read the events file using the function
613 >>> events_dict = events_file_to_annotation_kwargs(events_file, verbose=True)  # doctest:+ELLIPSIS
614 Reading events from .../events.tsv.
615 >>> events_dict
Expected:
    {'onset': array([0.1, 0.2, 0.3]),
    'duration': array([0.1, 0.1, 0.1]),
    'description': array(['event1', 'event2', 'event1'], dtype='<U6'),
    'event_id': {'event1': 1, 'event2': 2},
    'extras': [{'foo': 'a'}, {'foo': 'b'}, {'foo': 'c'}]}
Got:
    {'onset': array([0.1, 0.2, 0.3]),
    'duration': array([0.1, 0.1, 0.1]),
    'description': array(['event1', 'event2', 'event1'], dtype='<U6'),
    'event_id': {'event1': np.int64(1), 'event2': np.int64(2)},
    'extras': [{'foo': 'a'}, {'foo': 'b'}, {'foo': 'c'}]}

/home/larsoner/python/mne-bids/mne_bids/read.py:615: DocTestFailure

Maybe we should use https://github.com/scipy/scipy_doctest to avoid this sort of stuff? Could be worth doing in this PR if it magically fixes things here

@drammock
Copy link
Member Author

CIs unhappy. Pushed a little commit to get things further on my system where it still fails with NumPy-related stuff

hah. yeah, I made almost exactly those changes already over in #1475. This PR exists because I was trying to split up semantically unrelated changes into different PRs (to make reviewing easier), but then realized that no matter what I do this PR will still have the curryreader-related CI failures, and the curryreader PR will still have the doctest failures, so I just marked that PR as closing this one, and am doing everything over there now.

@sappelhoff sappelhoff marked this pull request as draft November 13, 2025 09:13
@drammock drammock deleted the fixdoctest branch November 13, 2025 20:38
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