Skip to content

Commit ec50c88

Browse files
committed
Merge remote-tracking branch 'upstream/main' into kernel
* upstream/main: MAINT: Add branch coverage (mne-tools#12174) OpenSSF (mne-tools#12175) fix docstring in 60_sleep.py (mne-tools#12171) FIX: skip empty lines in read_raw_eyelink (mne-tools#12172) FIX: Fix bug with coreg scalars (mne-tools#12164) Changed casting rule in np.clip to allow reading of raw GDF files (mne-tools#12168)
2 parents 3611ef8 + 8ea98e2 commit ec50c88

File tree

9 files changed

+37
-12
lines changed

9 files changed

+37
-12
lines changed

doc/changes/devel.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Enhancements
4949

5050
Bugs
5151
~~~~
52+
- Fix bug where :func:`mne.io.read_raw_gdf` would fail due to improper usage of ``np.clip`` (:gh:`12168` by :newcontrib:`Rasmus Aagaard`)
5253
- Fix bugs with :func:`mne.preprocessing.realign_raw` where the start of ``other`` was incorrectly cropped; and onsets and durations in ``other.annotations`` were left unsynced with the resampled data (:gh:`11950` by :newcontrib:`Qian Chu`)
5354
- Fix bug where ``encoding`` argument was ignored when reading annotations from an EDF file (:gh:`11958` by :newcontrib:`Andrew Gilbert`)
5455
- Mark tests ``test_adjacency_matches_ft`` and ``test_fetch_uncompressed_file`` as network tests (:gh:`12041` by :newcontrib:`Maksym Balatsko`)
@@ -70,7 +71,7 @@ Bugs
7071
- Fix bug where :class:`mne.Info` HTML representations listed all channel counts instead of good channel counts under the heading "Good channels" (:gh:`12145` by `Eric Larson`_)
7172
- Fix rendering glitches when plotting Neuromag/TRIUX sensors in :func:`mne.viz.plot_alignment` and related functions (:gh:`12098` by `Eric Larson`_)
7273
- Fix bug with delayed checking of :class:`info["bads"] <mne.Info>` (:gh:`12038` by `Eric Larson`_)
73-
- Fix bug with :ref:`mne coreg` where points inside the head surface were not shown (:gh:`12147` by `Eric Larson`_)
74+
- Fix bug with :ref:`mne coreg` where points inside the head surface were not shown (:gh:`12147`, :gh:`12164` by `Eric Larson`_)
7475
- Fix bug with :func:`mne.viz.plot_alignment` where ``sensor_colors`` were not handled properly on a per-channel-type basis (:gh:`12067` by `Eric Larson`_)
7576
- Fix handling of channel information in annotations when loading data from and exporting to EDF file (:gh:`11960` :gh:`12017` :gh:`12044` by `Paul Roujansky`_)
7677
- Add missing ``overwrite`` and ``verbose`` parameters to :meth:`Transform.save() <mne.transforms.Transform.save>` (:gh:`12004` by `Marijn van Vliet`_)

doc/changes/names.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@
442442

443443
.. _ramonapariciog: https://github.com/ramonapariciog
444444

445+
.. _Rasmus Aagaard: https://github.com/rasgaard
446+
445447
.. _Rasmus Zetter: https://people.aalto.fi/rasmus.zetter
446448

447449
.. _Reza Nasri: https://github.com/rznas

mne/io/edf/edf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ def _read_gdf_header(fname, exclude, include=None):
14431443
else:
14441444
chn = np.zeros(n_events, dtype=np.uint32)
14451445
dur = np.ones(n_events, dtype=np.uint32)
1446-
np.clip(dur, 1, np.inf, out=dur)
1446+
np.maximum(dur, 1, out=dur)
14471447
events = [n_events, pos, typ, chn, dur]
14481448
edf_info["event_sfreq"] = event_sr
14491449

@@ -1878,7 +1878,7 @@ def read_raw_gdf(
18781878
input_fname = os.path.abspath(input_fname)
18791879
ext = os.path.splitext(input_fname)[1][1:].lower()
18801880
if ext != "gdf":
1881-
raise NotImplementedError(f"Only BDF files are supported, got {ext}.")
1881+
raise NotImplementedError(f"Only GDF files are supported, got {ext}.")
18821882
return RawGDF(
18831883
input_fname=input_fname,
18841884
eog=eog,

mne/io/eyelink/_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ def _parse_recording_blocks(fname):
122122
is_recording_block = True
123123
if is_recording_block:
124124
tokens = line.split()
125+
if not tokens:
126+
continue # skip empty lines
125127
if tokens[0][0].isnumeric(): # Samples
126128
data_dict["sample_lines"].append(tokens)
127129
elif tokens[0] in data_dict["event_lines"].keys():

mne/viz/backends/_pyvista.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,9 @@ def quiver3d(
655655
clim=None,
656656
):
657657
_check_option("mode", mode, ALLOWED_QUIVER_MODES)
658+
_validate_type(scale_mode, str, "scale_mode")
659+
scale_map = dict(none=False, scalar="scalars", vector="vec")
660+
_check_option("scale_mode", scale_mode, list(scale_map))
658661
with warnings.catch_warnings():
659662
warnings.filterwarnings("ignore", category=FutureWarning)
660663
factor = scale
@@ -667,7 +670,10 @@ def quiver3d(
667670
grid = UnstructuredGrid(*args)
668671
if scalars is None:
669672
scalars = np.ones((n_points,))
670-
grid.point_data["scalars"] = np.array(scalars)
673+
mesh_scalars = None
674+
else:
675+
mesh_scalars = "scalars"
676+
grid.point_data["scalars"] = np.array(scalars, float)
671677
grid.point_data["vec"] = vectors
672678
if mode == "2darrow":
673679
return _arrow_glyph(grid, factor), grid
@@ -715,14 +721,17 @@ def quiver3d(
715721
glyph.Update()
716722
geom = glyph.GetOutput()
717723
mesh = grid.glyph(
718-
orient="vec", scale=scale_mode == "vector", factor=factor, geom=geom
724+
orient="vec",
725+
scale=scale_map[scale_mode],
726+
factor=factor,
727+
geom=geom,
719728
)
720729
actor = _add_mesh(
721730
self.plotter,
722731
mesh=mesh,
723732
color=color,
724733
opacity=opacity,
725-
scalars=None,
734+
scalars=mesh_scalars,
726735
colormap=colormap,
727736
show_scalar_bar=False,
728737
backface_culling=backface_culling,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ ignore-decorators = [
128128

129129
[tool.pytest.ini_options]
130130
addopts = """--durations=20 --doctest-modules -ra --cov-report= --tb=short \
131-
--doctest-ignore-import-errors --junit-xml=junit-results.xml \
131+
--cov-branch --doctest-ignore-import-errors --junit-xml=junit-results.xml \
132132
--ignore=doc --ignore=logo --ignore=examples --ignore=tutorials \
133133
--ignore=mne/gui/_*.py --ignore=mne/icons --ignore=tools \
134134
--ignore=mne/report/js_and_css \

tools/dev/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
dev-activity: check_steering_committee.py
44
python check_steering_committee.py
55

6-
unacknowledged-bugs: unacknowledged-bug-reports.jq bug-reports-12-to-2-months-old.json
7-
@jq -f unacknowledged-bug-reports.jq bug-reports-12-to-2-months-old.json
6+
unacknowledged-bug-reports: unacknowledged-issues.jq bug-reports-12-to-2-months-old.json
7+
@echo "MUST acknowledge bug reports (OpenSSF criterion: 50%)"
8+
@jq -f unacknowledged-issues.jq bug-reports-12-to-2-months-old.json
9+
10+
unacknowledged-feature-requests: unacknowledged-issues.jq feature-requests-12-to-2-months-old.json
11+
@echo "SHOULD acknowledge feature requests (OpenSSF criterion: 50%)"
12+
@jq -f unacknowledged-issues.jq feature-requests-12-to-2-months-old.json
813

914
bug-reports-12-to-2-months-old.json:
1015
@echo "Querying GitHub REST API..."
1116
@gh issue list \
1217
-l bug \
1318
--json state,number,title,createdAt,comments > bug-reports-12-to-2-months-old.json
1419

20+
feature-requests-12-to-2-months-old.json:
21+
@echo "Querying GitHub REST API..."
22+
@gh issue list \
23+
-l enh \
24+
--json state,number,title,createdAt,comments > feature-requests-12-to-2-months-old.json
25+
1526
clean:
1627
@rm bug-reports-12-to-2-months-old.json || true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Processor for `gh issue list` output that displays unacknowledged bug reports
1+
# Processor for `gh issue list` output that displays unacknowledged issues
22
# that are 2-12 months old. The date range is specific to OpenSSF best practices.
33

44
# `now` is in seconds since the unix epoch
@@ -28,5 +28,5 @@ map(
2828
"range": make_pretty_date_range,
2929
"has_dev_comments": map(select(.devComments > 0)) | length,
3030
"no_dev_comments": map(select(.devComments == 0) and .state == "OPEN") | length,
31-
"unaddressed_bug_reports": map(select(.devComments == 0) | make_issue_url),
31+
"unaddressed": map(select(.devComments == 0) | make_issue_url),
3232
}

tutorials/clinical/60_sleep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def eeg_power_band(epochs):
249249
250250
Returns
251251
-------
252-
X : numpy array of shape [n_samples, 5]
252+
X : numpy array of shape [n_samples, 5 * n_channels]
253253
Transformed data.
254254
"""
255255
# specific frequency bands

0 commit comments

Comments
 (0)