Skip to content

Commit 33a35a5

Browse files
committed
Merge branch 'annotations-details' of https://github.com/PierreGtch/mne-python into annotations-details
2 parents 68fb8b3 + a421357 commit 33a35a5

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

mne/annotations.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
)
3232
from .utils import (
3333
_check_dict_keys,
34-
_check_forbidden_values,
3534
_check_dt,
3635
_check_fname,
36+
_check_forbidden_values,
3737
_check_option,
3838
_check_pandas_installed,
3939
_check_time_format,
@@ -79,8 +79,7 @@ def _validate_details(details, length: int):
7979
return [None] * length
8080
if len(details) != length:
8181
raise ValueError(
82-
f"Details must be None or a list of length {length}, got "
83-
f"{len(details)}."
82+
f"Details must be None or a list of length {length}, got {len(details)}."
8483
)
8584
for i, d in enumerate(details):
8685
_validate_type(d, (dict, DetailsDict, None), f"details[{i}]", "dict or None")

mne/epochs.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3585,7 +3585,9 @@ def __init__(
35853585
pd = _check_pandas_installed(strict=True)
35863586
details_df = annotations.details_data_frame
35873587
details_df.set_index(metadata.index, inplace=True)
3588-
metadata = pd.concat([metadata, details_df], axis=1, ignore_index=False)
3588+
metadata = pd.concat(
3589+
[metadata, details_df], axis=1, ignore_index=False
3590+
)
35893591

35903592
# call BaseEpochs constructor
35913593
super().__init__(

mne/tests/test_epochs.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,12 @@ def test_average_movements():
479479
def _assert_drop_log_types(drop_log):
480480
__tracebackhide__ = True
481481
assert isinstance(drop_log, tuple), "drop_log should be tuple"
482-
assert all(
483-
isinstance(log, tuple) for log in drop_log
484-
), "drop_log[ii] should be tuple"
485-
assert all(
486-
isinstance(s, str) for log in drop_log for s in log
487-
), "drop_log[ii][jj] should be str"
482+
assert all(isinstance(log, tuple) for log in drop_log), (
483+
"drop_log[ii] should be tuple"
484+
)
485+
assert all(isinstance(s, str) for log in drop_log for s in log), (
486+
"drop_log[ii][jj] should be str"
487+
)
488488

489489

490490
def test_reject():

mne/utils/check.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ def _validate_type(item, types=None, item_name=None, type_name=None, *, extra=""
612612
(
613613
(type(None),)
614614
if type_ is None
615-
else (type_,) if not isinstance(type_, str) else _multi[type_]
615+
else (type_,)
616+
if not isinstance(type_, str)
617+
else _multi[type_]
616618
)
617619
for type_ in types
618620
),
@@ -625,7 +627,9 @@ def _validate_type(item, types=None, item_name=None, type_name=None, *, extra=""
625627
(
626628
"None"
627629
if cls_ is None
628-
else cls_.__name__ if not isinstance(cls_, str) else cls_
630+
else cls_.__name__
631+
if not isinstance(cls_, str)
632+
else cls_
629633
)
630634
for cls_ in types
631635
]

0 commit comments

Comments
 (0)