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

Updating mne_bids version #586

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Conversation

brunaafl
Copy link
Collaborator

Just as pointed at #581 (comment), moabb is using version 0.13 of mne_bids, which conflicts with mne if it's version is >= 1.7 since some functions on mne.io were removed.

I just changed version on poetry's pyproject file and reupdated the lock.

If mne's version is 1.6.1, it still accepts the modified imports from .io returning a warning, but not 1.7. My question is if it is prudent to also update mne's version to get rid of those warnings, but then needing to maybe change some other imports in other files.

Thanks for the attention!

@brunaafl
Copy link
Collaborator Author

@bruAristimunha

Just as pointed at #581 (comment), moabb is using version 0.13 of mne_bids, which conflicts with mne if it's version is >= 1.7 since some functions on mne.io were removed.

I just changed version on poetry's pyproject file and reupdated the lock.

If mne's version is 1.6.1, it still accepts the modified imports from .io returning a warning, but not 1.7. My question is if it is prudent to also update mne's version to get rid of those warnings, but then needing to maybe change some other imports in other files.

Thanks for the attention!

@bruAristimunha

@bruAristimunha
Copy link
Collaborator

bruAristimunha commented Apr 30, 2024

Hey @brunaafl,

About the mne, I think we can pay this bill now and avoid future issues.

@brunaafl
Copy link
Collaborator Author

brunaafl commented May 3, 2024

KeyErrors building docs. Is failing some auto examples. Ex:

WARNING: /home/runner/work/moabb/moabb/examples/plot_disk_cache.py failed to execute correctly: Traceback (most recent call last):
  File "/home/runner/work/moabb/moabb/examples/plot_disk_cache.py", line 130, in <module>
    _ = paradigm.get_data(dataset, subjects, cache_config=cache_config)
  File "/home/runner/work/moabb/moabb/moabb/paradigms/base.py", line 279, in get_data
    data = [
  File "/home/runner/work/moabb/moabb/moabb/paradigms/base.py", line 280, in <listcomp>
    dataset.get_data(
  File "/home/runner/work/moabb/moabb/moabb/datasets/base.py", line 343, in get_data
    data[subject] = self._get_single_subject_data_using_cache(
  File "/home/runner/work/moabb/moabb/moabb/datasets/base.py", line 508, in _get_single_subject_data_using_cache
    interface.erase()  # remove partial cache
  File "/home/runner/work/moabb/moabb/moabb/datasets/bids_interface.py", line 161, in erase
    path.rm(safe_remove=False)
  File "<decorator-gen-289>", line 12, in rm
  File "/home/runner/work/moabb/moabb/.venv/lib/python3.9/site-packages/mne_bids/path.py", line 711, in rm
    bids_path.copy()
  File "/home/runner/work/moabb/moabb/.venv/lib/python3.9/site-packages/mne_bids/path.py", line 12[42](https://github.com/NeuroTechX/moabb/actions/runs/8932160739/job/24550908772#step:9:43), in find_matching_sidecar
    return _find_matching_sidecar(
  File "/home/runner/work/moabb/moabb/.venv/lib/python3.9/site-packages/mne_bids/path.py", line 1836, in _find_matching_sidecar
    raise RuntimeError(msg)
RuntimeError: Did not find any scans.tsv associated with sub-1_ses-0_task-imagery_run-0_desc-bdedf68b003a1894e1a92bd91d0bbb7c.

The search_str was "/tmp/tmpi4jrw13t/MNE-BIDS-zhou2016/sub-1/**/sub-1_ses-0*scans.tsv"

Import error on tests below. As I could understand, mne 1.7 requires package edfio for writing files in EDF format. However, mne_bids 0.14 still uses EDFlib-Python and will add support for edfio just in 0.15 version (dev right now).

ERROR: test_cache_dataset (moabb.tests.datasets.Test_Datasets)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/work/moabb/moabb/.venv/lib/python3.9/site-packages/mne/utils/check.py", line 399, in _soft_import
    mod = import_module(name)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'edfio'

@bruAristimunha
Copy link
Collaborator

@brunaafl, this issue related with stimulus is related with mne-bids version?

@brunaafl
Copy link
Collaborator Author

brunaafl commented May 8, 2024

@brunaafl, this issue related with stimulus is related with mne-bids version?

Yes! As I could notice, the issue related to test_cache_dataset is directly related to incompatibility between mne_bids 0.14 and mne1.7. The problem related to Zhou dataset it could be, although I'm not 100% sure about the source of this error.

I think maybe the best way to proceed would be to go back to enforcing mne<=1.6.1 until the next mne_bids release?

@brunaafl
Copy link
Collaborator Author

brunaafl commented May 8, 2024

I've changed the version of mne to 1.6.1, but not mne_bids (still 0.14). If the problem with Zhou dataset is related to mne_bids 0.14, the error on the example must persist. I'm just interested in checking it.

@bruAristimunha
Copy link
Collaborator

Hmmmm, all green

@sylvchev
Copy link
Member

Everything seems ok, the doc build correctly, including Zhou examples.

@brunaafl
Copy link
Collaborator Author

That's interesting. I will try to investigate more the source of this problem

@brunaafl
Copy link
Collaborator Author

@brunaafl, this issue related with stimulus is related with mne-bids version?

Yes! As I could notice, the issue related to test_cache_dataset is directly related to incompatibility between mne_bids 0.14 and mne1.7. The problem related to Zhou dataset it could be, although I'm not 100% sure about the source of this error.

I think maybe the best way to proceed would be to go back to enforcing mne<=1.6.1 until the next mne_bids release?

In the end, reproducing the problem, I realized that it is actually a problem also related to the missing edfio package, causing failure while saving the data.

2024-05-16 16:30:01,869 INFO MainThread moabb.datasets.bids_interface Starting caching 'Zhou2016' sub-1 datatype-eeg desc-bdedf68
/home/brunalopes/PycharmProjects/moabb/moabb/datasets/bids_interface.py:349: RuntimeWarning: Converting data files to EDF format
  mne_bids.write_raw_bids(
2024-05-16 16:30:01,900 WARNING MainThread moabb.datasets.base Failed to save 'Zhou2016' sub-1 datatype-eeg desc-bdedf68 to BIDS format:

Importing edfio inside my environment solved the issue and the example finished running. If we want mne=1.7.0 as a requirement, it could be a provisional solution to add edfio as a requirement while mne_bids 0.15 is not released.

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.

None yet

3 participants