Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
jobs:
build_docs:
docker:
- image: cimg/python:3.12.6
- image: cimg/python:3.13.11
steps:
# Get our data and merge with upstream
- checkout
Expand All @@ -25,7 +25,7 @@ jobs:

deploy:
docker:
- image: cimg/python:3.12.6
- image: cimg/python:3.13.11
steps:
- add_ssh_keys:
fingerprints:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ jobs:
MNE_STIM_CHANNEL: 'STI101'
OPENBLAS_NUM_THREADS: '1'
PYTHONUNBUFFERED: '1'
PYTHON_VERSION: '3.10'
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.13'
name: 'Setup python'
- run: |
pip install --upgrade --only-binary=":all:" pip setuptools wheel
pip install --upgrade --only-binary=":all:" numpy scipy matplotlib h5io
pip install --upgrade pyyaml patsy pytest pytest-cov codecov flake8 pydocstyle numpydoc git+https://github.com/mne-tools/mne-python@main
pip install --upgrade --only-binary=":all:" -ve .
pip install --upgrade pyyaml patsy pytest pytest-cov codecov flake8 pydocstyle numpydoc
name: Install
- run: make flake
- run: pytest mnefun
Expand Down
8 changes: 6 additions & 2 deletions doc/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,12 @@ tmin : float
tmax : float
tmax for events.
t_adjust : float
Adjustment for delays (e.g., -4e-3 compensates for a 4 ms delay
in the trigger.
Adjustment for delays, e.g., -65e-3 compensates for a 65 ms delay
between when the trigger was sent and the actual real-life event occurred
(like a screen display) by moving the trigger later in time.
It is used in the ``epoching`` and ``covariance`` steps as::

events[:, 0] += int(np.round(-params.t_adjust * sfreq))
baseline : tuple | None | str
Baseline to use. If "individual", use ``params.bmin`` and
``params.bmax``, otherwise pass as the baseline parameter to
Expand Down
2 changes: 1 addition & 1 deletion mnefun/_atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def get_atlas_roi_mask(stc, roi, atlas='IXI', atlas_subject=None,
src = read_source_spaces(fname_src)
mri = op.join(subjects_dir, atlas_subject, 'mri',
'%s_brain_ANTS_%s_atlas.mgz' % (atlas_subject, atlas))
if not np.in1d(stc.vertices, src[0]['vertno']).all():
if not np.isin(stc.vertices, src[0]['vertno']).all():
raise RuntimeError('stc does not appear to be created from %s '
'volumetric source space' % (atlas_subject,))
rr = src[0]['rr'][stc.vertices]
Expand Down
6 changes: 3 additions & 3 deletions mnefun/_inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def get_fsaverage_medial_vertices(concatenate=True, subjects_dir=None,
lh = read_label(op.join(label_dir, 'lh.Medial_wall.label'))
rh = read_label(op.join(label_dir, 'rh.Medial_wall.label'))
if concatenate:
bad_left = np.where(np.in1d(vertices[0], lh.vertices))[0]
bad_right = np.where(np.in1d(vertices[1], rh.vertices))[0]
bad_left = np.where(np.isin(vertices[0], lh.vertices))[0]
bad_right = np.where(np.isin(vertices[1], rh.vertices))[0]
return np.concatenate((bad_left, bad_right + len(vertices[0])))
else:
return [lh.vertices, rh.vertices]
Expand All @@ -184,7 +184,7 @@ def get_fsaverage_label_operator(parc='aparc.a2009s', remove_bads=True,
bads = dict(lh=bads[0], rh=bads[1])
assert all(b.size > 1 for b in bads.values())
labels = [label for label in labels
if np.in1d(label.vertices, bads[label.hemi]).mean() < 0.8]
if np.isin(label.vertices, bads[label.hemi]).mean() < 0.8]
del bads
if combine_medial:
labels = combine_medial_labels(labels)
Expand Down
2 changes: 1 addition & 1 deletion mnefun/_mnefun.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def score_fun(p, subjects, run_indices):
run_indices = [np.array(run_idx) if run_idx is not None
else np.arange(len(p.run_names)) for run_idx in run_indices]
assert all(run_idx.ndim == 1 for run_idx in run_indices)
assert all(np.in1d(r, np.arange(len(p.run_names))).all()
assert all(np.isin(r, np.arange(len(p.run_names))).all()
for r in run_indices)

# Actually do the work
Expand Down
2 changes: 1 addition & 1 deletion mnefun/_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ def _proj_fig(fname, info, proj_nums, proj_meg, kind, use_ch, duration):
ch_names = [info['ch_names'][pick]
for pick in mne.pick_types(info, meg=meg, eeg=eeg)]
# Some of these will be missing because of prebads
idx = np.where([np.in1d(ch_names, proj['data']['col_names']).all()
idx = np.where([np.isin(ch_names, proj['data']['col_names']).all()
for proj in projs])[0]
if len(idx) != count:
raise RuntimeError('Expected %d %s projector%s for channel type '
Expand Down
2 changes: 1 addition & 1 deletion mnefun/_scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _read_events(p, subj, ridx, raw, ratios, picker=None):
else:
these_events = read_events(fname)
if ids is not None:
these_events = these_events[np.in1d(these_events[:, 2], ids)]
these_events = these_events[np.isin(these_events[:, 2], ids)]
events.append(these_events)
assert len(events) == len(fnames)
if len(events) == 1 and len(raw._first_samps) > 1: # for split raw
Expand Down
6 changes: 2 additions & 4 deletions mnefun/_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@

from os import path as op

from .externals import tabulate
from ._paths import (get_raw_fnames, get_event_fnames, get_cov_fwd_inv_fnames,
get_epochs_evokeds_fnames, get_report_fnames, _prebad)
from ._fix import _all_files_fixed

# make our table tighter
tabulate.MIN_PADDING = 0


def _have_all(fnames):
"""Check to make sure all files exist."""
Expand Down Expand Up @@ -115,6 +111,8 @@ def print_proc_status(p, subjects, structurals, analyses, run_indices):
assert all(len(steps) == len(s) for s in steps_all)

# Print it out in a tabular manner
import tabulate
tabulate.MIN_PADDING = 0 # make our table tighter
headers = [''] + steps
table = [[subj] + [status_mapping[key] for key in subj_steps]
for subj, subj_steps in zip(subjects, steps_all)]
Expand Down
4 changes: 2 additions & 2 deletions mnefun/_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ def plot_chpi_snr_raw(raw, win_length, n_harmonics=None, show=True, *,
pick_grad = pick_types(raw.info, meg='grad', exclude=[])
nchan = len(pick_meg)
# grad and mag indices into an array that already has meg channels only
pick_mag_ = np.in1d(pick_meg, pick_mag).nonzero()[0]
pick_grad_ = np.in1d(pick_meg, pick_grad).nonzero()[0]
pick_mag_ = np.isin(pick_meg, pick_mag).nonzero()[0]
pick_grad_ = np.isin(pick_meg, pick_grad).nonzero()[0]

# create general linear model for the data
t = np.arange(buflen) / float(sfreq)
Expand Down
Empty file removed mnefun/externals/__init__.py
Empty file.
Loading
Loading