Skip to content
Open
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
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git,*.svg,package-lock.json,*.css,*.min.*,.codespellrc
check-hidden = true
ignore-regex = \b(ALS|nAm)\b
ignore-words-list = numer,reord,datas,fro,ons,shs,evnts,ist,aas,coo,ser

23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion python/libs/edfrw/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def dob(self):
@dob.setter
def dob(self, dob):
'''
If DOB is not known it must be an empy string '' or 'X'. If it
If DOB is not known it must be an empty string '' or 'X'. If it
is known, it must be entered as

(a) a string in EDF format 'dd-MMM-yy', as in '30-DEC-1999';
Expand Down
2 changes: 1 addition & 1 deletion python/libs/edfrw/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def read_record(self, rec_number):
self.header.number_of_bytes_in_header)
self._f.seek(pointer)
# Data are saved as int16, so the number of bytes to read is
# twice the number of samles requested.
# twice the number of samples requested.
nsamples = self.header.number_of_samples_in_data_record * 2
samples = self._f.read(nsamples)
samples = np.frombuffer(samples, 'int16')
Expand Down
4 changes: 2 additions & 2 deletions python/libs/edfrw/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ def write_data_record(self, buffer):
Signals are allowed to be acquired at different sampling rates.
The data are saved in data blocks (named 'data records' in the
specification). The total number of samples in the block is thus
determined by adding the sizes of the individiual signals
determined by adding the sizes of the individual signals
(`signal.number_of_samples_in_data_record`).

Each data block holds all data aquired during a time interval of
Each data block holds all data acquired during a time interval of
`header.duration_of_data_record` seconds, and the total number
of data records in the file are `header.number_of_data_records`.

Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/_freesurfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _mri_orientation(orientation):
Parameters
----------
orientation : str
Orientation that you want. Can be "axial", "saggital", or "coronal".
Orientation that you want. Can be "axial", "sagittal", or "coronal".

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/beamformer/tests/test_dics.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def test_real(_load_forward, idx):
reg = 1 # Lots of regularization for our toy dataset
filters_real = make_dics(epochs.info, fwd_surf, csd, label=label, reg=reg,
real_filter=True, inversion='single')
# Also test here that no warings are thrown - implemented to check whether
# Also test here that no warnings are thrown - implemented to check whether
# src should not be None warning occurs:
power, f = apply_dics_csd(csd, filters_real)

Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/bem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def make_watershed_bem(subject, subjects_dir=None, overwrite=False,
if op.isfile(T1_mgz):
new_info = _extract_volume_info(T1_mgz) if has_nibabel() else dict()
if not new_info:
warn('nibabel is not available or the volumn info is invalid.'
warn('nibabel is not available or the volume info is invalid.'
'Volume info not updated in the written surface.')
surfs = ['brain', 'inner_skull', 'outer_skull', 'outer_skin']
for s in surfs:
Expand Down
4 changes: 2 additions & 2 deletions python/libs/mne/channels/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def _make_interpolation_matrix(pos_from, pos_to, alpha=1e-5):
Parameters
----------
pos_from : np.ndarray of float, shape(n_good_sensors, 3)
The positions to interpoloate from.
The positions to interpolate from.
pos_to : np.ndarray of float, shape(n_bad_sensors, 3)
The positions to interpoloate.
The positions to interpolate.
alpha : float
Regularization parameter. Defaults to 1e-5.

Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ def fit_fiducials(self, lpa_weight=1., nasion_weight=10., rpa_weight=1.,
self._log_dig_mri_distance('Start')
n_scale_params = self._n_scale_params
if n_scale_params == 3:
# enfore 1 even for 3-axis here (3 points is not enough)
# enforce 1 even for 3-axis here (3 points is not enough)
logger.info("Enforcing 1 scaling parameter for fit "
"with fiducials.")
n_scale_params = 1
Expand Down
6 changes: 3 additions & 3 deletions python/libs/mne/data/FreeSurferColorLUT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
169 Left-Basal-Ganglia 236 13 127 0
176 Right-Basal-Ganglia 236 13 126 0

# Label names and colors for Brainstem consituents
# Label names and colors for Brainstem constituents
# No. Label Name: R G B A
170 brainstem 119 159 176 0
171 DCG 119 0 176 0
Expand Down Expand Up @@ -416,14 +416,14 @@
# created by mri_aparc2aseg in which the aseg cortex label is replaced
# by the labels in the aparc. It also supports wm labels that will
# eventually be created by mri_aparc2aseg. Otherwise, the aseg labels
# do not change from above. The cortical lables are the same as in
# do not change from above. The cortical labels are the same as in
# colortable_desikan_killiany.txt, except that left hemisphere has
# 1000 added to the index and the right has 2000 added. The label
# names are also prepended with ctx-lh or ctx-rh. The white matter
# labels are the same as in colortable_desikan_killiany.txt, except
# that left hemisphere has 3000 added to the index and the right has
# 4000 added. The label names are also prepended with wm-lh or wm-rh.
# Centrum semiovale is also labled with 5001 (left) and 5002 (right).
# Centrum semiovale is also labeled with 5001 (left) and 5002 (right).
# Even further below are the color tables for aparc.a2005s and aparc.a2009s.

#No. Label Name: R G B A
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/decoding/ssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def fit(self, X, y=None):
self.filters_ = eigvects_[:, ix]
self.patterns_ = np.linalg.pinv(self.filters_)
# We assume that ordering by spectral ratio is more important
# than the initial ordering. This ording should be also learned when
# than the initial ordering. This ordering should be also learned when
# fitting.
X_ssd = self.filters_.T @ X[..., self.picks_, :]
sorter_spec = Ellipsis
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/decoding/tests/test_csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_csp_pipeline():

def test_ajd():
"""Test approximate joint diagonalization."""
# The implementation shuold obtain the same
# The implementation should obtain the same
# results as the Matlab implementation by Pham Dinh-Tuan.
# Generate a set of cavariances matrices for test purpose
n_times, n_channels = 10, 3
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/evoked.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def apply_baseline(self, baseline=(None, 0), *, verbose=None):
sfreq=self.info['sfreq'])
if self.baseline is not None and baseline is None:
raise ValueError('The data has already been baseline-corrected. '
'Cannot remove existing basline correction.')
'Cannot remove existing baseline correction.')
elif baseline is None:
# Do not rescale
logger.info(_log_rescale(None))
Expand Down
6 changes: 3 additions & 3 deletions python/libs/mne/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def filter_data(data, sfreq, l_freq, h_freq, picks=None, filter_length='auto',

.. note:: If n_jobs > 1, more memory is required as
``len(picks) * n_times`` additional time points need to
be temporaily stored in memory.
be temporarily stored in memory.

For more information, see the tutorials
:ref:`disc-filtering` and :ref:`tut-filter-resample` and
Expand Down Expand Up @@ -1997,7 +1997,7 @@ def filter(self, l_freq, h_freq, picks=None, filter_length='auto',

.. note:: If n_jobs > 1, more memory is required as
``len(picks) * n_times`` additional time points need to
be temporaily stored in memory.
be temporarily stored in memory.

For more information, see the tutorials
:ref:`disc-filtering` and :ref:`tut-filter-resample` and
Expand Down Expand Up @@ -2146,7 +2146,7 @@ def apply_hilbert(self, picks=None, envelope=False, n_jobs=1, n_fft='auto',
If envelope=False, more memory is required since the original raw data
as well as the analytic signal have temporarily to be stored in memory.
If n_jobs > 1, more memory is required as ``len(picks) * n_times``
additional time points need to be temporaily stored in memory.
additional time points need to be temporarily stored in memory.

Also note that the ``n_fft`` parameter will allow you to pad the signal
with zeros before performing the Hilbert transform. This padding
Expand Down
4 changes: 2 additions & 2 deletions python/libs/mne/forward/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ def compute_depth_prior(forward, info, exp=0.8, limit=10.0,
prior dependent only on the sensor geometry (and relationship
to the sources).
* ``'whiten'``
Compute a whitener and apply it to the gain matirx before computing
Compute a whitener and apply it to the gain matrix before computing
the depth prior. In this case ``noise_cov`` must not be None.
Whitening the gain matrix makes the depth prior
depend on both sensor geometry and the data of interest captured
Expand Down Expand Up @@ -1256,7 +1256,7 @@ def compute_depth_prior(forward, info, exp=0.8, limit=10.0,
ws = np.sort(w)
weight_limit = limit ** 2
if limit_depth_chs is False:
# match old mne-python behavor
# match old mne-python behavior
# we used to do ind = np.argmin(ws), but this is 0 by sort above
n_limit = 0
limit = ws[0] * weight_limit
Expand Down
4 changes: 2 additions & 2 deletions python/libs/mne/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ def notch_filter(self, freqs, picks=None, filter_length='auto',

.. note:: If n_jobs > 1, more memory is required as
``len(picks) * n_times`` additional time points need to
be temporaily stored in memory.
be temporarily stored in memory.

For details, see :func:`mne.filter.notch_filter`.
"""
Expand Down Expand Up @@ -2052,7 +2052,7 @@ def _get_ch_factors(inst, units, picks_idxs):
Returns
-------
ch_factors : ndarray of floats, shape(len(picks),)
The sacling factors for each channel, ordered according
The scaling factors for each channel, ordered according
to picks.

"""
Expand Down
6 changes: 3 additions & 3 deletions python/libs/mne/io/brainvision/brainvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ def _get_vhdr_info(vhdr_fname, eog, misc, scale):
highpass = [float(filt) if filt not in ('NaN', 'Off', 'DC')
else np.Inf for filt in highpass]
info['highpass'] = np.max(np.array(highpass, dtype=np.float64))
# Coveniently enough 1 / np.Inf = 0.0, so this works for
# Conveniently enough 1 / np.Inf = 0.0, so this works for
# DC / no highpass filter
# filter time constant t [secs] to Hz conversion: 1/2*pi*t
info['highpass'] = 1. / (2 * np.pi * info['highpass'])
Expand Down Expand Up @@ -901,7 +901,7 @@ def _parse_impedance(settings, recording_date=None):
Parameters
----------
settings : list
The header settings lines fom the VHDR file.
The header settings lines from the VHDR file.
recording_date : datetime.datetime | None
The date of the recording as extracted from the VMRK file.

Expand Down Expand Up @@ -963,7 +963,7 @@ def _parse_impedance_ranges(settings):
Parameters
----------
settings : list
The header settings lines fom the VHDR file.
The header settings lines from the VHDR file.

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/io/curry/curry.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _first_hpi(fname):
break
else:
raise RuntimeError('Could not find valid HPI in %s' % (fname,))
# t is the first enttry
# t is the first entry
assert hpi.ndim == 1
hpi = hpi[1:]
hpi.shape = (-1, 5)
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/io/eeglab/tests/test_eeglab.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_degenerate(tmp_path):
@pytest.mark.parametrize("fname", [
raw_fname_mat,
raw_fname_onefile_mat,
# We don't test the h5 varaints here because they are implicitly tested
# We don't test the h5 variants here because they are implicitly tested
# in test_io_set_raw
])
@pytest.mark.filterwarnings('ignore: Complex objects')
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/io/nihon/nihon.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def __init__(self, fname, preload=False, verbose=None):
# Get annotations from LOG file
annots = _read_nihon_annotations(fname)

# Annotate acqusition skips
# Annotate acquisition skips
controlblock = self._header['controlblocks'][0]
cur_sample = 0
if controlblock['n_datablocks'] > 1:
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ def stc_to_label(stc, src=None, smooth=True, connected=False,


def _verts_within_dist(graph, sources, max_dist):
"""Find all vertices wihin a maximum geodesic distance from source.
"""Find all vertices within a maximum geodesic distance from source.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/preprocessing/tests/test_eeglab_infomax.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_mne_python_vs_eeglab():
% (method,
dict(eeg='eeg', mag='meg')[ch_type]))

# For comparasion against eeglab, make sure the following
# For comparison against eeglab, make sure the following
# parameters have the same value in mne_python and eeglab:
#
# - starting point
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/report/js_and_css/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const disableGlobalKeyHandler = () => {
window.onkeydown = null;
}

/* Disbale processing global key events when a search box is active */
/* Disable processing global key events when a search box is active */
const disableGlobalKeysInSearchBox = () => {
const searchBoxElements = document.querySelectorAll('input.search-input');
searchBoxElements.forEach((el) => {
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,7 @@ def _render_raw_butterfly_segments(
try:
raw.set_annotations(None)

# Create the figure once and re-use it for performance reasons
# Create the figure once and reuse it for performance reasons
with use_browser_backend('matplotlib'):
fig = raw.plot(
butterfly=True, show_scrollbars=False, start=t_starts[0],
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/simulation/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def add_chpi(raw, head_pos=None, interp='cos2', n_jobs=1, verbose=None):
# turn on cHPI in file
data = raw._data
data[hpi_pick, :] = hpi_ons.sum()
_log_ch('cHPI status bits enbled and', info, hpi_pick)
_log_ch('cHPI status bits enabled and', info, hpi_pick)
sinusoids = 70e-9 * np.sin(2 * np.pi * hpi_freqs[:, np.newaxis] *
(np.arange(len(times)) / info['sfreq']))
info = pick_info(info, meg_picks)
Expand Down
4 changes: 2 additions & 2 deletions python/libs/mne/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ def _cart_to_sph(cart):


def _sph_to_cart(sph_pts):
"""Convert spherical coordinates to Cartesion coordinates.
"""Convert spherical coordinates to Cartesian coordinates.

Parameters
----------
Expand Down Expand Up @@ -1112,7 +1112,7 @@ def fit(self, source, destination, order=4, reg=1e-5, center=True,
src_rad_az_pol[0] = np.abs(np.dot(match_sph, src_coeffs))
dest_rad_az_pol = match_rad_az_pol.copy()
dest_rad_az_pol[0] = np.abs(np.dot(match_sph, dest_coeffs))
# 5. Convert matched points to Cartesion coordinates and put back
# 5. Convert matched points to Cartesian coordinates and put back
source = _sph_to_cart(src_rad_az_pol.T)
source += src_center
destination = _sph_to_cart(dest_rad_az_pol.T)
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
docdict['exclude_frontal'] = """
exclude_frontal : bool
If True, exclude points that have both negative Z values
(below the nasion) and positivy Y values (in front of the LPA/RPA).
(below the nasion) and positive Y values (in front of the LPA/RPA).
"""

docdict['export_edf_note'] = """
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne/viz/_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@ def _cut_coords_to_idx(cut_coords, img):
% (stc.vertices[0][loc_idx], dist))
return loc_idx

ax_name = dict(x='X (saggital)', y='Y (coronal)', z='Z (axial)')
ax_name = dict(x='X (sagittal)', y='Y (coronal)', z='Z (axial)')

def _click_to_cut_coords(event, params):
"""Get voxel coordinates from mouse click."""
Expand Down
6 changes: 3 additions & 3 deletions python/libs/mne/viz/_brain/_brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2268,7 +2268,7 @@ def add_label(self, label, color=None, alpha=1, scalar_thresh=None,
(away from the true border) along the cortical mesh to include
as part of the border definition.
hemi : str | None
If None, it is assumed to belong to the hemipshere being
If None, it is assumed to belong to the hemisphere being
shown.
subdir : None | str
If a label is specified as name, subdir can be used to indicate
Expand Down Expand Up @@ -2685,7 +2685,7 @@ def add_foci(self, coords, coords_as_verts=False, map_surface=None,
name : str
Internal name to use.
hemi : str | None
If None, it is assumed to belong to the hemipshere being
If None, it is assumed to belong to the hemisphere being
shown. If two hemispheres are being shown, an error will
be thrown.
resolution : int
Expand Down Expand Up @@ -2922,7 +2922,7 @@ def add_annotation(self, annot, borders=True, alpha=1, hemi=None,
as part of the border definition.
%(alpha)s Default is 1.
hemi : str | None
If None, it is assumed to belong to the hemipshere being
If None, it is assumed to belong to the hemisphere being
shown. If two hemispheres are being shown, data must exist
for both hemispheres.
remove_existing : bool
Expand Down
2 changes: 1 addition & 1 deletion python/libs/mne_bids/dig.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def _write_dig_bids(bids_path, raw, montage=None, acpc_aligned=False,

if montage is None:
montage = raw.get_montage()
else: # assign montage to raw but supress any coordinate transforms
else: # assign montage to raw but suppress any coordinate transforms
montage = montage.copy() # don't modify original
montage_coord_frame = montage.get_positions()['coord_frame']
fids = [d for d in montage.dig # save to add back
Expand Down
Loading