-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rm deprecated type-hints * fix FutureWarning mne 1.7 epochs view/copy * use a copy * Revert "use a copy" This reverts commit 10bc139. * fix * fix variable name
- Loading branch information
1 parent
bef9155
commit deec3c8
Showing
11 changed files
with
54 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
"""Class and functions to use modified Kmeans.""" | ||
|
||
from pathlib import Path | ||
from typing import Any, Optional, Tuple, Union | ||
from typing import Any, Optional, Union | ||
|
||
import numpy as np | ||
from mne import BaseEpochs | ||
|
@@ -263,7 +263,7 @@ def _kmeans( | |
max_iter: int, | ||
random_state: Union[RandomState, Generator], | ||
tol: Union[int, float], | ||
) -> Tuple[float, NDArray[float], NDArray[int], bool]: | ||
) -> tuple[float, NDArray[float], NDArray[int], bool]: | ||
"""Run the k-means algorithm.""" | ||
gfp_sum_sq = np.sum(data**2) | ||
maps, converged = ModKMeans._compute_maps( | ||
|
@@ -282,7 +282,7 @@ def _compute_maps( | |
max_iter: int, | ||
random_state: Union[RandomState, Generator], | ||
tol: Union[int, float], | ||
) -> Tuple[NDArray[float], bool]: | ||
) -> tuple[NDArray[float], bool]: | ||
"""Compute microstates maps. | ||
Based on mne_microstates by Marijn van Vliet <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,15 @@ | |
Inspired from mne.utils.docs.py by Eric Larson <[email protected]> | ||
""" | ||
import sys | ||
from typing import Callable, Dict, List, Tuple | ||
from typing import Callable | ||
|
||
from mne.utils.docs import docdict as docdict_mne | ||
|
||
# ------------------------- Documentation dictionary ------------------------- | ||
docdict: Dict[str, str] = {} | ||
docdict: dict[str, str] = {} | ||
|
||
# ---- Documentation to inc. from MNE ---- | ||
keys: Tuple[str, ...] = ( | ||
keys: tuple[str, ...] = ( | ||
"n_jobs", | ||
"picks_all", | ||
"random_state", | ||
|
@@ -169,7 +169,7 @@ | |
axes.""" | ||
|
||
# ------------------------- Documentation functions -------------------------- | ||
docdict_indented: Dict[int, Dict[str, str]] = {} | ||
docdict_indented: dict[int, dict[str, str]] = {} | ||
|
||
|
||
def fill_doc(f: Callable) -> Callable: | ||
|
@@ -215,7 +215,7 @@ def fill_doc(f: Callable) -> Callable: | |
return f | ||
|
||
|
||
def _indentcount_lines(lines: List[str]) -> int: | ||
def _indentcount_lines(lines: list[str]) -> int: | ||
"""Minimum indent for all lines in line list. | ||
>>> lines = [' one', ' two', ' three'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters