eegdash 0.4.0.dev171__py3-none-any.whl → 0.4.0.dev176__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of eegdash might be problematic. Click here for more details.
- eegdash/__init__.py +1 -1
- eegdash/data_utils.py +11 -3
- eegdash/features/datasets.py +5 -0
- eegdash/features/decorators.py +8 -0
- eegdash/features/extractors.py +9 -0
- eegdash/features/feature_bank/signal.py +11 -10
- eegdash/features/feature_bank/utils.py +8 -0
- eegdash/features/inspect.py +8 -0
- eegdash/features/serialization.py +5 -1
- eegdash/features/utils.py +5 -0
- {eegdash-0.4.0.dev171.dist-info → eegdash-0.4.0.dev176.dist-info}/METADATA +5 -3
- {eegdash-0.4.0.dev171.dist-info → eegdash-0.4.0.dev176.dist-info}/RECORD +15 -15
- {eegdash-0.4.0.dev171.dist-info → eegdash-0.4.0.dev176.dist-info}/WHEEL +0 -0
- {eegdash-0.4.0.dev171.dist-info → eegdash-0.4.0.dev176.dist-info}/licenses/LICENSE +0 -0
- {eegdash-0.4.0.dev171.dist-info → eegdash-0.4.0.dev176.dist-info}/top_level.txt +0 -0
eegdash/__init__.py
CHANGED
eegdash/data_utils.py
CHANGED
|
@@ -22,10 +22,10 @@ import mne
|
|
|
22
22
|
import mne_bids
|
|
23
23
|
import numpy as np
|
|
24
24
|
import pandas as pd
|
|
25
|
-
from bids import BIDSLayout
|
|
26
25
|
from joblib import Parallel, delayed
|
|
27
26
|
from mne._fiff.utils import _read_segments_file
|
|
28
27
|
from mne.io import BaseRaw
|
|
28
|
+
from mne.utils.check import _soft_import
|
|
29
29
|
from mne_bids import BIDSPath
|
|
30
30
|
|
|
31
31
|
from braindecode.datasets import BaseDataset
|
|
@@ -348,6 +348,14 @@ class EEGBIDSDataset:
|
|
|
348
348
|
data_dir=None, # location of bids dataset
|
|
349
349
|
dataset="", # dataset name
|
|
350
350
|
):
|
|
351
|
+
bids_lib = _soft_import("bids", purpose="digestion of datasets", strict=False)
|
|
352
|
+
|
|
353
|
+
if bids_lib is None:
|
|
354
|
+
raise ImportError(
|
|
355
|
+
"The 'pybids' package is required to use EEGBIDSDataset. "
|
|
356
|
+
"Please install it via 'pip install eegdash[digestion]'."
|
|
357
|
+
)
|
|
358
|
+
|
|
351
359
|
if data_dir is None or not os.path.exists(data_dir):
|
|
352
360
|
raise ValueError("data_dir must be specified and must exist")
|
|
353
361
|
self.bidsdir = Path(data_dir)
|
|
@@ -359,7 +367,7 @@ class EEGBIDSDataset:
|
|
|
359
367
|
raise AssertionError(
|
|
360
368
|
f"BIDS directory '{dir_name}' does not correspond to dataset '{self.dataset}'"
|
|
361
369
|
)
|
|
362
|
-
self.layout = BIDSLayout(data_dir)
|
|
370
|
+
self.layout = bids_lib.BIDSLayout(data_dir)
|
|
363
371
|
|
|
364
372
|
# get all recording files in the bids directory
|
|
365
373
|
self.files = self._get_recordings(self.layout)
|
|
@@ -379,7 +387,7 @@ class EEGBIDSDataset:
|
|
|
379
387
|
"""
|
|
380
388
|
return self.get_bids_file_attribute("modality", self.files[0]).lower() == "eeg"
|
|
381
389
|
|
|
382
|
-
def _get_recordings(self, layout
|
|
390
|
+
def _get_recordings(self, layout) -> list[str]:
|
|
383
391
|
"""Get a list of all EEG recording files in the BIDS layout."""
|
|
384
392
|
files = []
|
|
385
393
|
for ext, exts in self.RAW_EXTENSIONS.items():
|
eegdash/features/datasets.py
CHANGED
|
@@ -18,6 +18,11 @@ from braindecode.datasets.base import (
|
|
|
18
18
|
|
|
19
19
|
from ..logging import logger
|
|
20
20
|
|
|
21
|
+
__all__ = [
|
|
22
|
+
"FeaturesDataset",
|
|
23
|
+
"FeaturesConcatDataset",
|
|
24
|
+
]
|
|
25
|
+
|
|
21
26
|
|
|
22
27
|
class FeaturesDataset(EEGWindowsDataset):
|
|
23
28
|
"""A dataset of features extracted from EEG windows.
|
eegdash/features/decorators.py
CHANGED
|
@@ -10,6 +10,14 @@ from .extractors import (
|
|
|
10
10
|
_get_underlying_func,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
+
__all__ = [
|
|
14
|
+
"bivariate_feature",
|
|
15
|
+
"FeatureKind",
|
|
16
|
+
"FeaturePredecessor",
|
|
17
|
+
"multivariate_feature",
|
|
18
|
+
"univariate_feature",
|
|
19
|
+
]
|
|
20
|
+
|
|
13
21
|
|
|
14
22
|
class FeaturePredecessor:
|
|
15
23
|
"""A decorator to specify parent extractors for a feature function.
|
eegdash/features/extractors.py
CHANGED
|
@@ -8,6 +8,15 @@ from typing import Dict
|
|
|
8
8
|
import numpy as np
|
|
9
9
|
from numba.core.dispatcher import Dispatcher
|
|
10
10
|
|
|
11
|
+
__all__ = [
|
|
12
|
+
"BivariateFeature",
|
|
13
|
+
"DirectedBivariateFeature",
|
|
14
|
+
"FeatureExtractor",
|
|
15
|
+
"MultivariateFeature",
|
|
16
|
+
"TrainableFeature",
|
|
17
|
+
"UnivariateFeature",
|
|
18
|
+
]
|
|
19
|
+
|
|
11
20
|
|
|
12
21
|
def _get_underlying_func(func: Callable) -> Callable:
|
|
13
22
|
"""Get the underlying function from a potential wrapper.
|
|
@@ -8,20 +8,21 @@ from ..extractors import FeatureExtractor
|
|
|
8
8
|
|
|
9
9
|
__all__ = [
|
|
10
10
|
"HilbertFeatureExtractor",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"SIGNAL_PREDECESSORS",
|
|
12
|
+
"signal_decorrelation_time",
|
|
13
|
+
"signal_hjorth_activity",
|
|
14
|
+
"signal_hjorth_complexity",
|
|
15
|
+
"signal_hjorth_mobility",
|
|
14
16
|
"signal_kurtosis",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
+
"signal_line_length",
|
|
18
|
+
"signal_mean",
|
|
17
19
|
"signal_peak_to_peak",
|
|
18
20
|
"signal_quantile",
|
|
21
|
+
"signal_root_mean_square",
|
|
22
|
+
"signal_skewness",
|
|
23
|
+
"signal_std",
|
|
24
|
+
"signal_variance",
|
|
19
25
|
"signal_zero_crossings",
|
|
20
|
-
"signal_line_length",
|
|
21
|
-
"signal_hjorth_activity",
|
|
22
|
-
"signal_hjorth_mobility",
|
|
23
|
-
"signal_hjorth_complexity",
|
|
24
|
-
"signal_decorrelation_time",
|
|
25
26
|
]
|
|
26
27
|
|
|
27
28
|
|
eegdash/features/inspect.py
CHANGED
|
@@ -6,6 +6,14 @@ from collections.abc import Callable
|
|
|
6
6
|
from . import extractors, feature_bank
|
|
7
7
|
from .extractors import FeatureExtractor, MultivariateFeature, _get_underlying_func
|
|
8
8
|
|
|
9
|
+
__all__ = [
|
|
10
|
+
"get_all_feature_extractors",
|
|
11
|
+
"get_all_feature_kinds",
|
|
12
|
+
"get_all_features",
|
|
13
|
+
"get_feature_kind",
|
|
14
|
+
"get_feature_predecessors",
|
|
15
|
+
]
|
|
16
|
+
|
|
9
17
|
|
|
10
18
|
def get_feature_predecessors(feature_or_extractor: Callable) -> list:
|
|
11
19
|
"""Get the dependency hierarchy for a feature or feature extractor.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
See Also
|
|
4
4
|
--------
|
|
5
|
-
https://github.com/braindecode/braindecode
|
|
5
|
+
https://github.com/braindecode/braindecode/blob/master/braindecode/datautil/serialization.py#L165-L229
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
@@ -18,6 +18,10 @@ from braindecode.datautil.serialization import _load_kwargs_json
|
|
|
18
18
|
|
|
19
19
|
from .datasets import FeaturesConcatDataset, FeaturesDataset
|
|
20
20
|
|
|
21
|
+
__all__ = [
|
|
22
|
+
"load_features_concat_dataset",
|
|
23
|
+
]
|
|
24
|
+
|
|
21
25
|
|
|
22
26
|
def load_features_concat_dataset(
|
|
23
27
|
path: str | Path, ids_to_load: list[int] | None = None, n_jobs: int = 1
|
eegdash/features/utils.py
CHANGED
|
@@ -17,6 +17,11 @@ from braindecode.datasets.base import (
|
|
|
17
17
|
from .datasets import FeaturesConcatDataset, FeaturesDataset
|
|
18
18
|
from .extractors import FeatureExtractor
|
|
19
19
|
|
|
20
|
+
__all__ = [
|
|
21
|
+
"extract_features",
|
|
22
|
+
"fit_feature_extractors",
|
|
23
|
+
]
|
|
24
|
+
|
|
20
25
|
|
|
21
26
|
def _extract_features_from_windowsdataset(
|
|
22
27
|
win_ds: EEGWindowsDataset | WindowsDataset,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eegdash
|
|
3
|
-
Version: 0.4.0.
|
|
3
|
+
Version: 0.4.0.dev176
|
|
4
4
|
Summary: EEG data for machine learning
|
|
5
5
|
Author-email: Young Truong <dt.young112@gmail.com>, Arnaud Delorme <adelorme@gmail.com>, Aviv Dotan <avivd220@gmail.com>, Oren Shriki <oren70@gmail.com>, Bruno Aristimunha <b.aristimunha@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -29,11 +29,9 @@ Requires-Dist: mne_bids>=0.17.0
|
|
|
29
29
|
Requires-Dist: numba
|
|
30
30
|
Requires-Dist: numpy
|
|
31
31
|
Requires-Dist: pandas
|
|
32
|
-
Requires-Dist: pybids
|
|
33
32
|
Requires-Dist: pymongo
|
|
34
33
|
Requires-Dist: python-dotenv
|
|
35
34
|
Requires-Dist: s3fs
|
|
36
|
-
Requires-Dist: scipy
|
|
37
35
|
Requires-Dist: tqdm
|
|
38
36
|
Requires-Dist: h5io>=0.2.4
|
|
39
37
|
Requires-Dist: pymatreader
|
|
@@ -44,6 +42,7 @@ Requires-Dist: rich
|
|
|
44
42
|
Provides-Extra: tests
|
|
45
43
|
Requires-Dist: pytest; extra == "tests"
|
|
46
44
|
Requires-Dist: pytest-cov; extra == "tests"
|
|
45
|
+
Requires-Dist: pytest-sugar; extra == "tests"
|
|
47
46
|
Requires-Dist: codecov; extra == "tests"
|
|
48
47
|
Requires-Dist: pytest_cases; extra == "tests"
|
|
49
48
|
Requires-Dist: pytest-benchmark; extra == "tests"
|
|
@@ -66,10 +65,13 @@ Requires-Dist: lightgbm; extra == "docs"
|
|
|
66
65
|
Requires-Dist: plotly; extra == "docs"
|
|
67
66
|
Requires-Dist: nbformat; extra == "docs"
|
|
68
67
|
Requires-Dist: graphviz; extra == "docs"
|
|
68
|
+
Provides-Extra: digestion
|
|
69
|
+
Requires-Dist: pybids; extra == "digestion"
|
|
69
70
|
Provides-Extra: all
|
|
70
71
|
Requires-Dist: eegdash[docs]; extra == "all"
|
|
71
72
|
Requires-Dist: eegdash[dev]; extra == "all"
|
|
72
73
|
Requires-Dist: eegdash[tests]; extra == "all"
|
|
74
|
+
Requires-Dist: eegdash[digestion]; extra == "all"
|
|
73
75
|
Dynamic: license-file
|
|
74
76
|
|
|
75
77
|
# EEG-Dash
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
eegdash/__init__.py,sha256=
|
|
1
|
+
eegdash/__init__.py,sha256=A7Uh_kXQuDzVmoSuZyWHE7RRxwhA2_JzaAmLD7LZM4E,704
|
|
2
2
|
eegdash/api.py,sha256=az7uUYrEvJfBtzvkzYKzXqEztDSCMsCmgIywpdzYqc8,38381
|
|
3
3
|
eegdash/bids_eeg_metadata.py,sha256=kEmFUe07tivkuIoC5T-YwfO4QQYJBxuc769ZBV1UCKo,16682
|
|
4
4
|
eegdash/const.py,sha256=9WMetN7YMQJbkN2PhzItxtVRZ4VBXLP82vFu9pY6xok,9066
|
|
5
|
-
eegdash/data_utils.py,sha256=
|
|
5
|
+
eegdash/data_utils.py,sha256=LOA-8ShugnIXlqmGmmSClTCBr3khQSconmYAcvT_9tY,26528
|
|
6
6
|
eegdash/downloader.py,sha256=Z-9EEJildqJxIihwdtXc_h9kzCkuF9LWIwQEfyG9Huw,6030
|
|
7
7
|
eegdash/logging.py,sha256=OQ4jMtwv1h-gzjxmr3PCpcsKi5-3Nhd3r9PJ4UN7oQI,1467
|
|
8
8
|
eegdash/mongodb.py,sha256=9FJDeEebOD5RzNYfAf1lhr0R-pECAlnug6Sjhd9_oUw,3469
|
|
@@ -13,25 +13,25 @@ eegdash/dataset/dataset.py,sha256=DnR6LoirPNV45MECq42MNtIPyhL7DTFuwPWavVWZmmA,81
|
|
|
13
13
|
eegdash/dataset/dataset_summary.csv,sha256=YJX-BitOyo-5nsHBd3ECIY1u7lFBjMQAFfCUPLYEgpo,25289
|
|
14
14
|
eegdash/dataset/registry.py,sha256=5TOCWalA0RV7omRoYS0OzdcSaOTvXvqos74_Vj2jv0M,9127
|
|
15
15
|
eegdash/features/__init__.py,sha256=BXNhjvL4_SSFAY1lcP9nyGpkbJNtoOMH4AHlF6OyABo,4078
|
|
16
|
-
eegdash/features/datasets.py,sha256
|
|
17
|
-
eegdash/features/decorators.py,sha256=
|
|
18
|
-
eegdash/features/extractors.py,sha256=
|
|
19
|
-
eegdash/features/inspect.py,sha256=
|
|
20
|
-
eegdash/features/serialization.py,sha256=
|
|
21
|
-
eegdash/features/utils.py,sha256=
|
|
16
|
+
eegdash/features/datasets.py,sha256=-Y-CxBypJu3dHyNDLFKFIo-zIi4qEInahZTgJslnrVQ,24636
|
|
17
|
+
eegdash/features/decorators.py,sha256=VOCeL6rFa8wqkRJRnecWaTqdBW2B9MO724vGGk1AkGo,3965
|
|
18
|
+
eegdash/features/extractors.py,sha256=R4csU3jj95xndtWI1VuMKoKi26xprzmuOp9wcy9iVzI,11937
|
|
19
|
+
eegdash/features/inspect.py,sha256=XYuEDkiwNhEFYS0a0auyn8E96WvMaPrpNn4nMRk2foM,4069
|
|
20
|
+
eegdash/features/serialization.py,sha256=Um5fseiyk7SXmXoSLaaVRl2-0a6iAiRLm5rAmqdYfpg,3938
|
|
21
|
+
eegdash/features/utils.py,sha256=DiutW7SOVU0pnkRTKvWpdca0RW4UCJD6JvHGDNJPjXk,6161
|
|
22
22
|
eegdash/features/feature_bank/__init__.py,sha256=YsMXLC1FEtHL3IEw9pYw1fc5IY0x_hr2qWQowI5gZj8,2991
|
|
23
23
|
eegdash/features/feature_bank/complexity.py,sha256=eOLN0X_xaS15ZpLPDQcychuwjL459-FqZKYfOG51z-g,3366
|
|
24
24
|
eegdash/features/feature_bank/connectivity.py,sha256=bQ6KlxWm5GNpCS9ypLqBUr2L171Yq7wpBQT2tRQKTZ4,2159
|
|
25
25
|
eegdash/features/feature_bank/csp.py,sha256=jKPrmqBj7FliybNbg035cVZddvVSkhk9OazcscDpipU,3303
|
|
26
26
|
eegdash/features/feature_bank/dimensionality.py,sha256=Pit3YNxv64-qHUyz_5c3nBo4sFD5AnCE5mTwgnzSndc,3980
|
|
27
|
-
eegdash/features/feature_bank/signal.py,sha256=
|
|
27
|
+
eegdash/features/feature_bank/signal.py,sha256=iSMrgnZLKNn1qNdBPheEoE_UcJPPLAOv3qDTaRI1BcE,3431
|
|
28
28
|
eegdash/features/feature_bank/spectral.py,sha256=bNB7skusePs1gX7NOU6yRlw_Gr4UOCkO_ylkCgybzug,3319
|
|
29
|
-
eegdash/features/feature_bank/utils.py,sha256=
|
|
29
|
+
eegdash/features/feature_bank/utils.py,sha256=zCdkfDMLWJhPjBqb5Xz0jLKg8gm3qQDY1G1rZTLuCaM,1354
|
|
30
30
|
eegdash/hbn/__init__.py,sha256=hsI5pmIuYDzr--aE5UiToO-P9XL5fVRKahZzdsAodro,794
|
|
31
31
|
eegdash/hbn/preprocessing.py,sha256=xp0HBz8WGhLI5c2Zkk4QiVUzGoIZep8YypnHNZsUJ4o,3800
|
|
32
32
|
eegdash/hbn/windows.py,sha256=Z_fhG3kaHd5MAPg60FwFnxMJay8EzacXytUaCsOENGc,14408
|
|
33
|
-
eegdash-0.4.0.
|
|
34
|
-
eegdash-0.4.0.
|
|
35
|
-
eegdash-0.4.0.
|
|
36
|
-
eegdash-0.4.0.
|
|
37
|
-
eegdash-0.4.0.
|
|
33
|
+
eegdash-0.4.0.dev176.dist-info/licenses/LICENSE,sha256=asisR-xupy_NrQBFXnx6yqXeZcYWLvbAaiETl25iXT0,931
|
|
34
|
+
eegdash-0.4.0.dev176.dist-info/METADATA,sha256=85mnc40qlaAusZRVmbWhmM9RaD29YxaReud8ICVuDp4,6927
|
|
35
|
+
eegdash-0.4.0.dev176.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
eegdash-0.4.0.dev176.dist-info/top_level.txt,sha256=zavO69HQ6MyZM0aQMR2zUS6TAFc7bnN5GEpDpOpFZzU,8
|
|
37
|
+
eegdash-0.4.0.dev176.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|