-
Notifications
You must be signed in to change notification settings - Fork 11
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
MAINT: Future compatibility with MNE 1.6 #120
Changes from all commits
d9bfdec
48acbf5
415beba
c3d3de4
cc77008
604417c
2537a19
c5bdc20
6a9c57c
1c6799d
c54070e
33e7c96
9c80239
a2dcf7b
496af70
57d3cdf
c77904b
2309859
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,15 @@ | |
from typing import Any, Union | ||
|
||
import numpy as np | ||
from mne.io import Info | ||
from mne.io.pick import _picks_to_idx, pick_info | ||
from mne import Info, pick_info | ||
from mne.utils import check_version | ||
from numpy.typing import NDArray | ||
|
||
if check_version("mne", "1.6"): | ||
from mne._fiff.pick import _picks_to_idx | ||
else: | ||
from mne.io.pick import _picks_to_idx | ||
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You already saw that, but that's the syntax I used to load correctly the functions we used. I don't think it's adding a large maintenance burden, and we can keep MNE < 1.6 and >= 1.6. |
||
|
||
from .._typing import CHData, CHInfo | ||
from ..utils._checks import _check_type | ||
from ..utils._docs import fill_doc | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,30 +8,53 @@ | |
from typing import List, Union | ||
|
||
import numpy as np | ||
from mne.io import Info | ||
from mne.io._digitization import _format_dig_points, _read_dig_fif | ||
from mne import Info, Transform | ||
from mne.io.constants import FIFF | ||
from mne.io.ctf_comp import _read_ctf_comp, write_ctf_comp | ||
from mne.io.meas_info import _read_bad_channels, _write_ch_infos | ||
from mne.io.open import fiff_open | ||
from mne.io.proj import _read_proj, _write_proj | ||
from mne.io.tag import read_tag | ||
from mne.io.tree import dir_tree_find | ||
from mne.io.write import ( | ||
end_block, | ||
start_and_end_file, | ||
start_block, | ||
write_coord_trans, | ||
write_dig_points, | ||
write_double_matrix, | ||
write_id, | ||
write_int, | ||
write_name_list, | ||
write_string, | ||
) | ||
from mne.transforms import Transform, invert_transform | ||
from mne.transforms import invert_transform | ||
from mne.utils import check_version | ||
from numpy.typing import NDArray | ||
|
||
if check_version("mne", "1.6"): | ||
from mne._fiff._digitization import _format_dig_points, _read_dig_fif | ||
from mne._fiff.ctf_comp import _read_ctf_comp, write_ctf_comp | ||
from mne._fiff.meas_info import _read_bad_channels, _write_ch_infos | ||
from mne._fiff.open import fiff_open | ||
from mne._fiff.proj import _read_proj, _write_proj | ||
from mne._fiff.tag import read_tag | ||
from mne._fiff.tree import dir_tree_find | ||
from mne._fiff.write import ( | ||
end_block, | ||
start_and_end_file, | ||
start_block, | ||
write_coord_trans, | ||
write_dig_points, | ||
write_double_matrix, | ||
write_id, | ||
write_int, | ||
write_name_list, | ||
write_string, | ||
) | ||
else: | ||
from mne.io._digitization import _format_dig_points, _read_dig_fif | ||
from mne.io.ctf_comp import _read_ctf_comp, write_ctf_comp | ||
from mne.io.meas_info import _read_bad_channels, _write_ch_infos | ||
from mne.io.open import fiff_open | ||
from mne.io.proj import _read_proj, _write_proj | ||
from mne.io.tag import read_tag | ||
from mne.io.tree import dir_tree_find | ||
from mne.io.write import ( | ||
end_block, | ||
start_and_end_file, | ||
start_block, | ||
write_coord_trans, | ||
write_dig_points, | ||
write_double_matrix, | ||
write_id, | ||
write_int, | ||
write_name_list, | ||
write_string, | ||
) | ||
|
||
from .. import __version__ | ||
from .._typing import CHInfo | ||
from ..cluster import AAHCluster, ModKMeans | ||
|
@@ -521,13 +544,13 @@ def _read_meas_info(fid, tree): | |
pos = meas_info["directory"][k].pos | ||
if kind == FIFF.FIFF_NCHAN: | ||
tag = read_tag(fid, pos) | ||
nchan = int(tag.data) | ||
nchan = int(tag.data.item()) | ||
elif kind == FIFF.FIFF_CH_INFO: | ||
tag = read_tag(fid, pos) | ||
chs.append(tag.data) | ||
elif kind == FIFF.FIFF_MNE_CUSTOM_REF: | ||
tag = read_tag(fid, pos) | ||
custom_ref_applied = int(tag.data) | ||
custom_ref_applied = int(tag.data.item()) | ||
Comment on lines
-524
to
+553
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
elif kind == FIFF.FIFF_COORD_TRANS: | ||
tag = read_tag(fid, pos) | ||
cand = tag.data | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the one test I changed. Instead of installing only MNE (main), I also install the pre-release version of numpy, scipy, scikit-learn and matplotlib (they need each other to work here, we can't mix a pre-release numpy with the current stable matplotlib or scikit-learn).