mne-tools / mne-bids

MNE-BIDS is a Python package that allows you to read and write BIDS-compatible datasets with the help of MNE-Python.
https://mne.tools/mne-bids/
BSD 3-Clause "New" or "Revised" License
131 stars 85 forks source link

Fix numpy 2.0 deprecation #1184

Closed mscheltienne closed 10 months ago

mscheltienne commented 10 months ago

Got:

ERROR mne_icalabel/annotation/tests/test_bids.py::test_write_channels_tsv - DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.
ERROR mne_icalabel/annotation/tests/test_bids.py::test_mark_components - DeprecationWarning: `in1d` is deprecated. Use `np.isin` instead.

with the traceback:

<decorator-gen-449>:10: in write_raw_bids
    ???
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/mne_bids/write.py:1994: in write_raw_bids
    _channels_tsv(raw, channels_path.fpath, overwrite)
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/mne_bids/write.py:192: in _channels_tsv
    ch_data = _drop(ch_data, ignored_channels, "name")
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/mne_bids/tsv_handler.py:118: in _drop
    mask = np.in1d(new_data_col, values, invert=True)

when running mne-icalalbel pytest against mne_bids (main) and numpy 2.0.

sappelhoff commented 10 months ago

Thanks @mscheltienne, enabled auto-merge :-)