eegdash 0.3.1__py3-none-any.whl → 0.3.1.dev51__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 +19 -9
- eegdash/features/feature_bank/complexity.py +3 -1
- eegdash/features/feature_bank/csp.py +1 -1
- {eegdash-0.3.1.dist-info → eegdash-0.3.1.dev51.dist-info}/METADATA +4 -2
- {eegdash-0.3.1.dist-info → eegdash-0.3.1.dev51.dist-info}/RECORD +9 -9
- {eegdash-0.3.1.dist-info → eegdash-0.3.1.dev51.dist-info}/licenses/LICENSE +2 -0
- {eegdash-0.3.1.dist-info → eegdash-0.3.1.dev51.dist-info}/WHEEL +0 -0
- {eegdash-0.3.1.dist-info → eegdash-0.3.1.dev51.dist-info}/top_level.txt +0 -0
eegdash/__init__.py
CHANGED
eegdash/data_utils.py
CHANGED
|
@@ -55,21 +55,25 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
55
55
|
self.cache_dir = Path(cache_dir)
|
|
56
56
|
bids_kwargs = self.get_raw_bids_args()
|
|
57
57
|
|
|
58
|
-
self.bidspath = BIDSPath(
|
|
59
|
-
root=self.cache_dir / record["dataset"],
|
|
60
|
-
datatype="eeg",
|
|
61
|
-
suffix="eeg",
|
|
62
|
-
**bids_kwargs,
|
|
63
|
-
)
|
|
64
58
|
if s3_bucket:
|
|
65
59
|
self.s3_bucket = s3_bucket
|
|
66
60
|
self.s3_open_neuro = False
|
|
61
|
+
bids_root = self.cache_dir
|
|
62
|
+
self.filecache = self.cache_dir / record["bidspath"]
|
|
67
63
|
else:
|
|
68
64
|
self.s3_bucket = self._AWS_BUCKET
|
|
69
65
|
self.s3_open_neuro = True
|
|
66
|
+
bids_root = self.cache_dir / record["dataset"]
|
|
67
|
+
self.filecache = self.cache_dir / record["bidspath"]
|
|
68
|
+
|
|
69
|
+
self.bidspath = BIDSPath(
|
|
70
|
+
root=bids_root,
|
|
71
|
+
datatype="eeg",
|
|
72
|
+
suffix="eeg",
|
|
73
|
+
**bids_kwargs,
|
|
74
|
+
)
|
|
70
75
|
|
|
71
76
|
self.s3file = self.get_s3path(record["bidspath"])
|
|
72
|
-
self.filecache = self.cache_dir / record["bidspath"]
|
|
73
77
|
self.bids_dependencies = record["bidsdependencies"]
|
|
74
78
|
# Temporary fix for BIDS dependencies path
|
|
75
79
|
# just to release to the competition
|
|
@@ -85,14 +89,18 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
85
89
|
return f"{self.s3_bucket}/{filepath}"
|
|
86
90
|
|
|
87
91
|
def _download_s3(self) -> None:
|
|
88
|
-
"""
|
|
89
|
-
self.filecache.parent.mkdir(parents=True, exist_ok=True)
|
|
92
|
+
"""Download function that gets the raw EEG data from S3."""
|
|
90
93
|
filesystem = s3fs.S3FileSystem(
|
|
91
94
|
anon=True, client_kwargs={"region_name": "us-east-2"}
|
|
92
95
|
)
|
|
93
96
|
if not self.s3_open_neuro:
|
|
94
97
|
self.s3file = re.sub(r"(^|/)ds\d{6}/", r"\1", self.s3file, count=1)
|
|
98
|
+
self.filecache = re.sub(
|
|
99
|
+
r"(^|/)ds\d{6}/", r"\1", str(self.filecache), count=1
|
|
100
|
+
)
|
|
101
|
+
self.filecache = Path(self.filecache)
|
|
95
102
|
|
|
103
|
+
self.filecache.parent.mkdir(parents=True, exist_ok=True)
|
|
96
104
|
filesystem.download(self.s3file, self.filecache)
|
|
97
105
|
self.filenames = [self.filecache]
|
|
98
106
|
|
|
@@ -106,6 +114,8 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
106
114
|
for dep in self.bids_dependencies:
|
|
107
115
|
s3path = self.get_s3path(dep)
|
|
108
116
|
filepath = self.cache_dir / dep
|
|
117
|
+
# here, we download the dependency and it is fine
|
|
118
|
+
# in the case of the competition.
|
|
109
119
|
if not filepath.exists():
|
|
110
120
|
filepath.parent.mkdir(parents=True, exist_ok=True)
|
|
111
121
|
filesystem.download(s3path, filepath)
|
|
@@ -71,7 +71,7 @@ def complexity_svd_entropy(x, m=10, tau=1):
|
|
|
71
71
|
@FeaturePredecessor(*SIGNAL_PREDECESSORS)
|
|
72
72
|
@univariate_feature
|
|
73
73
|
@nb.njit(cache=True, fastmath=True)
|
|
74
|
-
def complexity_lempel_ziv(x, threshold=None):
|
|
74
|
+
def complexity_lempel_ziv(x, threshold=None, normalize=True):
|
|
75
75
|
lzc = np.empty(x.shape[:-1])
|
|
76
76
|
for i in np.ndindex(x.shape[:-1]):
|
|
77
77
|
t = np.median(x[i]) if threshold is None else threshold
|
|
@@ -97,4 +97,6 @@ def complexity_lempel_ziv(x, threshold=None):
|
|
|
97
97
|
j, k, k_max = 0, 1, 1
|
|
98
98
|
else:
|
|
99
99
|
k = 1
|
|
100
|
+
if normalize:
|
|
101
|
+
lzc[i] *= np.log2(n) / n
|
|
100
102
|
return lzc
|
|
@@ -97,5 +97,5 @@ class CommonSpatialPattern(TrainableFeature):
|
|
|
97
97
|
+ "all weights were filtered out."
|
|
98
98
|
)
|
|
99
99
|
proj = (self.transform_input(x) - self._mean) @ w
|
|
100
|
-
proj = proj.reshape(x.shape[0], x.shape[2], -1).
|
|
100
|
+
proj = proj.reshape(x.shape[0], x.shape[2], -1).var(axis=1)
|
|
101
101
|
return {f"{i}": proj[:, i] for i in range(proj.shape[-1])}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eegdash
|
|
3
|
-
Version: 0.3.1
|
|
3
|
+
Version: 0.3.1.dev51
|
|
4
4
|
Summary: EEG data for machine learning
|
|
5
|
-
Author-email: Young Truong <dt.young112@gmail.com>, Arnaud Delorme <adelorme@gmail.com>, Bruno Aristimunha <b.aristimunha@gmail.com>
|
|
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: GNU General Public License
|
|
7
7
|
|
|
8
8
|
Copyright (C) 2024-2025
|
|
9
9
|
|
|
10
10
|
Young Truong, UCSD, dt.young112@gmail.com
|
|
11
11
|
Arnaud Delorme, UCSD, adelorme@ucsd.edu
|
|
12
|
+
Aviv Dotan, BGU, avivdot@bgu.post.ac.il
|
|
13
|
+
Oren Shriki, BGU, shrikio@bgu.ac.il
|
|
12
14
|
Bruno Aristimunha, b.aristimunha@gmail.com
|
|
13
15
|
|
|
14
16
|
This program is free software; you can redistribute it and/or modify
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
eegdash/__init__.py,sha256=
|
|
1
|
+
eegdash/__init__.py,sha256=gfDfEiCyZNcpnl_NcJnYqr4r9XfSMxxSwIrAmP56K-8,238
|
|
2
2
|
eegdash/api.py,sha256=igpkLTCjH6NNQf8tEizA6SF8cYa1gE22-hNVxNRPszg,26747
|
|
3
3
|
eegdash/data_config.py,sha256=OS6ERO-jHrnEOfMJUehY7ieABdsRw_qWzOKJ4pzSfqw,1323
|
|
4
|
-
eegdash/data_utils.py,sha256
|
|
4
|
+
eegdash/data_utils.py,sha256=-K_S5rGBUDYZl7U7b27DBPeQKt0jIf-pbj3H6ExnHoY,24603
|
|
5
5
|
eegdash/dataset.py,sha256=BngXb9TtAo0Sjc3o5bRC0fJkQrThdsqzx2Zpvp7xtvs,2374
|
|
6
6
|
eegdash/mongodb.py,sha256=GD3WgA253oFgpzOHrYaj4P1mRjNtDMT5Oj4kVvHswjI,2006
|
|
7
7
|
eegdash/preprocessing.py,sha256=7S_TTRKPKEk47tTnh2D6WExBt4cctAMxUxGDjJqq5lU,2221
|
|
@@ -14,15 +14,15 @@ eegdash/features/inspect.py,sha256=PmbWhx5H_WqpnorUpWONUSkUtaIHkZblRa_Xyk7Szyc,1
|
|
|
14
14
|
eegdash/features/serialization.py,sha256=snXuHVd0CoT2ese0iWi5RwZrVHCGc0oCZ8-SXqGY88I,2848
|
|
15
15
|
eegdash/features/utils.py,sha256=eM6DdyOpdVfNh7dSPykJ0WaTDtaGvkCQWAmW0G8v60Y,3784
|
|
16
16
|
eegdash/features/feature_bank/__init__.py,sha256=YsMXLC1FEtHL3IEw9pYw1fc5IY0x_hr2qWQowI5gZj8,2991
|
|
17
|
-
eegdash/features/feature_bank/complexity.py,sha256=
|
|
17
|
+
eegdash/features/feature_bank/complexity.py,sha256=iy9uaLInsYdxKZlXHTWlgEpP9fVI-v9TqLGfnS15-Eg,3258
|
|
18
18
|
eegdash/features/feature_bank/connectivity.py,sha256=bQ6KlxWm5GNpCS9ypLqBUr2L171Yq7wpBQT2tRQKTZ4,2159
|
|
19
|
-
eegdash/features/feature_bank/csp.py,sha256=
|
|
19
|
+
eegdash/features/feature_bank/csp.py,sha256=jKPrmqBj7FliybNbg035cVZddvVSkhk9OazcscDpipU,3303
|
|
20
20
|
eegdash/features/feature_bank/dimensionality.py,sha256=j_Ds71Y1AbV2uLFQj8EuXQ4kzofLBlQtPV5snMkF7i4,3965
|
|
21
21
|
eegdash/features/feature_bank/signal.py,sha256=3Tb8z9gX7iZipxQJ9DSyy30JfdmW58kgvimSyZX74p8,3404
|
|
22
22
|
eegdash/features/feature_bank/spectral.py,sha256=bNB7skusePs1gX7NOU6yRlw_Gr4UOCkO_ylkCgybzug,3319
|
|
23
23
|
eegdash/features/feature_bank/utils.py,sha256=DGh-Q7-XFIittP7iBBxvsJaZrlVvuY5mw-G7q6C-PCI,1237
|
|
24
|
-
eegdash-0.3.1.dist-info/licenses/LICENSE,sha256=
|
|
25
|
-
eegdash-0.3.1.dist-info/METADATA,sha256=
|
|
26
|
-
eegdash-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
-
eegdash-0.3.1.dist-info/top_level.txt,sha256=zavO69HQ6MyZM0aQMR2zUS6TAFc7bnN5GEpDpOpFZzU,8
|
|
28
|
-
eegdash-0.3.1.dist-info/RECORD,,
|
|
24
|
+
eegdash-0.3.1.dev51.dist-info/licenses/LICENSE,sha256=asisR-xupy_NrQBFXnx6yqXeZcYWLvbAaiETl25iXT0,931
|
|
25
|
+
eegdash-0.3.1.dev51.dist-info/METADATA,sha256=eiLWVqqlZi3hgMEXOkcJk2vDlc5eTHNQ7drdh8CKyCQ,10784
|
|
26
|
+
eegdash-0.3.1.dev51.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
eegdash-0.3.1.dev51.dist-info/top_level.txt,sha256=zavO69HQ6MyZM0aQMR2zUS6TAFc7bnN5GEpDpOpFZzU,8
|
|
28
|
+
eegdash-0.3.1.dev51.dist-info/RECORD,,
|
|
@@ -4,6 +4,8 @@ Copyright (C) 2024-2025
|
|
|
4
4
|
|
|
5
5
|
Young Truong, UCSD, dt.young112@gmail.com
|
|
6
6
|
Arnaud Delorme, UCSD, adelorme@ucsd.edu
|
|
7
|
+
Aviv Dotan, BGU, avivdot@bgu.post.ac.il
|
|
8
|
+
Oren Shriki, BGU, shrikio@bgu.ac.il
|
|
7
9
|
Bruno Aristimunha, b.aristimunha@gmail.com
|
|
8
10
|
|
|
9
11
|
This program is free software; you can redistribute it and/or modify
|
|
File without changes
|
|
File without changes
|