eegdash 0.3.1.dev51__tar.gz → 0.3.2.dev54__tar.gz
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-0.3.1.dev51 → eegdash-0.3.2.dev54}/PKG-INFO +13 -3
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/README.md +12 -2
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/__init__.py +1 -1
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/api.py +5 -1
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/data_utils.py +15 -14
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/dataset.py +2 -2
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash.egg-info/PKG-INFO +13 -3
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/tests/test_dataset.py +18 -6
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/LICENSE +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/data_config.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/__init__.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/datasets.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/decorators.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/extractors.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/__init__.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/complexity.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/connectivity.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/csp.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/dimensionality.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/signal.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/spectral.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/feature_bank/utils.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/inspect.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/serialization.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/features/utils.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/mongodb.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/preprocessing.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash/utils.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash.egg-info/SOURCES.txt +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash.egg-info/dependency_links.txt +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash.egg-info/requires.txt +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/eegdash.egg-info/top_level.txt +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/pyproject.toml +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/setup.cfg +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/tests/test_correctness.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/tests/test_eegdash.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/tests/test_init.py +0 -0
- {eegdash-0.3.1.dev51 → eegdash-0.3.2.dev54}/tests/test_mongo_connection.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eegdash
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2.dev54
|
|
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: GNU General Public License
|
|
@@ -98,6 +98,14 @@ Dynamic: license-file
|
|
|
98
98
|
|
|
99
99
|
# EEG-Dash
|
|
100
100
|
|
|
101
|
+
[](https://pypi.org/project/eegdash/)
|
|
102
|
+
[](https://sccn.github.io/eegdash)
|
|
103
|
+
|
|
104
|
+
[](LICENSE)
|
|
105
|
+
[](https://pypi.org/project/eegdash/)
|
|
106
|
+
[](https://pepy.tech/project/eegdash)
|
|
107
|
+
<!-- [](https://codecov.io/gh/sccn/eegdash) -->
|
|
108
|
+
|
|
101
109
|
To leverage recent and ongoing advancements in large-scale computational methods and to ensure the preservation of scientific data generated from publicly funded research, the EEG-DaSh data archive will create a data-sharing resource for MEEG (EEG, MEG) data contributed by collaborators for machine learning (ML) and deep learning (DL) applications.
|
|
102
110
|
|
|
103
111
|
## Data source
|
|
@@ -143,7 +151,9 @@ To use the data from a single subject, enter:
|
|
|
143
151
|
from eegdash import EEGDashDataset
|
|
144
152
|
|
|
145
153
|
ds_NDARDB033FW5 = EEGDashDataset(
|
|
146
|
-
{"dataset": "ds005514", "task":
|
|
154
|
+
{"dataset": "ds005514", "task":
|
|
155
|
+
"RestingState", "subject": "NDARDB033FW5"},
|
|
156
|
+
cache_dir="."
|
|
147
157
|
)
|
|
148
158
|
```
|
|
149
159
|
|
|
@@ -155,7 +165,7 @@ To use the data from multiple subjects, enter:
|
|
|
155
165
|
from eegdash import EEGDashDataset
|
|
156
166
|
|
|
157
167
|
ds_ds005505rest = EEGDashDataset(
|
|
158
|
-
{"dataset": "ds005505", "task": "RestingState"}, target_name="sex"
|
|
168
|
+
{"dataset": "ds005505", "task": "RestingState"}, target_name="sex", cache_dir=".
|
|
159
169
|
)
|
|
160
170
|
```
|
|
161
171
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# EEG-Dash
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/eegdash/)
|
|
4
|
+
[](https://sccn.github.io/eegdash)
|
|
5
|
+
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://pypi.org/project/eegdash/)
|
|
8
|
+
[](https://pepy.tech/project/eegdash)
|
|
9
|
+
<!-- [](https://codecov.io/gh/sccn/eegdash) -->
|
|
10
|
+
|
|
3
11
|
To leverage recent and ongoing advancements in large-scale computational methods and to ensure the preservation of scientific data generated from publicly funded research, the EEG-DaSh data archive will create a data-sharing resource for MEEG (EEG, MEG) data contributed by collaborators for machine learning (ML) and deep learning (DL) applications.
|
|
4
12
|
|
|
5
13
|
## Data source
|
|
@@ -45,7 +53,9 @@ To use the data from a single subject, enter:
|
|
|
45
53
|
from eegdash import EEGDashDataset
|
|
46
54
|
|
|
47
55
|
ds_NDARDB033FW5 = EEGDashDataset(
|
|
48
|
-
{"dataset": "ds005514", "task":
|
|
56
|
+
{"dataset": "ds005514", "task":
|
|
57
|
+
"RestingState", "subject": "NDARDB033FW5"},
|
|
58
|
+
cache_dir="."
|
|
49
59
|
)
|
|
50
60
|
```
|
|
51
61
|
|
|
@@ -57,7 +67,7 @@ To use the data from multiple subjects, enter:
|
|
|
57
67
|
from eegdash import EEGDashDataset
|
|
58
68
|
|
|
59
69
|
ds_ds005505rest = EEGDashDataset(
|
|
60
|
-
{"dataset": "ds005505", "task": "RestingState"}, target_name="sex"
|
|
70
|
+
{"dataset": "ds005505", "task": "RestingState"}, target_name="sex", cache_dir=".
|
|
61
71
|
)
|
|
62
72
|
```
|
|
63
73
|
|
|
@@ -532,7 +532,7 @@ class EEGDashDataset(BaseConcatDataset):
|
|
|
532
532
|
"gender",
|
|
533
533
|
"sex",
|
|
534
534
|
],
|
|
535
|
-
cache_dir: str = "
|
|
535
|
+
cache_dir: str = "~/eegdash_cache",
|
|
536
536
|
s3_bucket: str | None = None,
|
|
537
537
|
**kwargs,
|
|
538
538
|
):
|
|
@@ -587,6 +587,10 @@ class EEGDashDataset(BaseConcatDataset):
|
|
|
587
587
|
)
|
|
588
588
|
)
|
|
589
589
|
|
|
590
|
+
self.filesystem = S3FileSystem(
|
|
591
|
+
anon=True, client_kwargs={"region_name": "us-east-2"}
|
|
592
|
+
)
|
|
593
|
+
|
|
590
594
|
super().__init__(datasets)
|
|
591
595
|
|
|
592
596
|
def find_key_in_nested_dict(self, data: Any, target_key: str) -> Any:
|
|
@@ -53,24 +53,24 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
53
53
|
super().__init__(None, **kwargs)
|
|
54
54
|
self.record = record
|
|
55
55
|
self.cache_dir = Path(cache_dir)
|
|
56
|
-
bids_kwargs = self.get_raw_bids_args()
|
|
56
|
+
self.bids_kwargs = self.get_raw_bids_args()
|
|
57
57
|
|
|
58
58
|
if s3_bucket:
|
|
59
59
|
self.s3_bucket = s3_bucket
|
|
60
60
|
self.s3_open_neuro = False
|
|
61
|
-
bids_root = self.cache_dir
|
|
62
|
-
self.filecache = self.cache_dir / record["bidspath"]
|
|
63
61
|
else:
|
|
64
62
|
self.s3_bucket = self._AWS_BUCKET
|
|
65
63
|
self.s3_open_neuro = True
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
|
|
65
|
+
self.filecache = self.cache_dir / record["bidspath"]
|
|
66
|
+
|
|
67
|
+
self.bids_root = self.cache_dir / record["dataset"]
|
|
68
68
|
|
|
69
69
|
self.bidspath = BIDSPath(
|
|
70
|
-
root=bids_root,
|
|
70
|
+
root=self.bids_root,
|
|
71
71
|
datatype="eeg",
|
|
72
72
|
suffix="eeg",
|
|
73
|
-
**bids_kwargs,
|
|
73
|
+
**self.bids_kwargs,
|
|
74
74
|
)
|
|
75
75
|
|
|
76
76
|
self.s3file = self.get_s3path(record["bidspath"])
|
|
@@ -78,6 +78,7 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
78
78
|
# Temporary fix for BIDS dependencies path
|
|
79
79
|
# just to release to the competition
|
|
80
80
|
if not self.s3_open_neuro:
|
|
81
|
+
self.bids_dependencies_original = self.bids_dependencies
|
|
81
82
|
self.bids_dependencies = [
|
|
82
83
|
dep.split("/", 1)[1] for dep in self.bids_dependencies
|
|
83
84
|
]
|
|
@@ -95,12 +96,9 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
95
96
|
)
|
|
96
97
|
if not self.s3_open_neuro:
|
|
97
98
|
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)
|
|
102
99
|
|
|
103
100
|
self.filecache.parent.mkdir(parents=True, exist_ok=True)
|
|
101
|
+
|
|
104
102
|
filesystem.download(self.s3file, self.filecache)
|
|
105
103
|
self.filenames = [self.filecache]
|
|
106
104
|
|
|
@@ -111,8 +109,11 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
111
109
|
filesystem = s3fs.S3FileSystem(
|
|
112
110
|
anon=True, client_kwargs={"region_name": "us-east-2"}
|
|
113
111
|
)
|
|
114
|
-
for dep in self.bids_dependencies:
|
|
112
|
+
for i, dep in enumerate(self.bids_dependencies):
|
|
115
113
|
s3path = self.get_s3path(dep)
|
|
114
|
+
if not self.s3_open_neuro:
|
|
115
|
+
dep = self.bids_dependencies_original[i]
|
|
116
|
+
|
|
116
117
|
filepath = self.cache_dir / dep
|
|
117
118
|
# here, we download the dependency and it is fine
|
|
118
119
|
# in the case of the competition.
|
|
@@ -207,7 +208,7 @@ class EEGDashBaseRaw(BaseRaw):
|
|
|
207
208
|
metadata: dict[str, Any],
|
|
208
209
|
preload: bool = False,
|
|
209
210
|
*,
|
|
210
|
-
cache_dir: str = "
|
|
211
|
+
cache_dir: str = "~/eegdash_cache",
|
|
211
212
|
bids_dependencies: list[str] = [],
|
|
212
213
|
verbose: Any = None,
|
|
213
214
|
):
|
|
@@ -244,7 +245,7 @@ class EEGDashBaseRaw(BaseRaw):
|
|
|
244
245
|
print(f"Getting S3 path for {filepath}")
|
|
245
246
|
return f"{self._AWS_BUCKET}/{filepath}"
|
|
246
247
|
|
|
247
|
-
def _download_s3(self):
|
|
248
|
+
def _download_s3(self) -> None:
|
|
248
249
|
self.filecache.parent.mkdir(parents=True, exist_ok=True)
|
|
249
250
|
filesystem = s3fs.S3FileSystem(
|
|
250
251
|
anon=True, client_kwargs={"region_name": "us-east-2"}
|
|
@@ -18,9 +18,9 @@ RELEASE_TO_OPENNEURO_DATASET_MAP = {
|
|
|
18
18
|
class EEGChallengeDataset(EEGDashDataset):
|
|
19
19
|
def __init__(
|
|
20
20
|
self,
|
|
21
|
-
release: str
|
|
21
|
+
release: str,
|
|
22
|
+
cache_dir: str,
|
|
22
23
|
query: dict | None = None,
|
|
23
|
-
cache_dir: str = ".eegdash_cache",
|
|
24
24
|
s3_bucket: str | None = "s3://nmdatasets/NeurIPS25",
|
|
25
25
|
**kwargs,
|
|
26
26
|
):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eegdash
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2.dev54
|
|
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: GNU General Public License
|
|
@@ -98,6 +98,14 @@ Dynamic: license-file
|
|
|
98
98
|
|
|
99
99
|
# EEG-Dash
|
|
100
100
|
|
|
101
|
+
[](https://pypi.org/project/eegdash/)
|
|
102
|
+
[](https://sccn.github.io/eegdash)
|
|
103
|
+
|
|
104
|
+
[](LICENSE)
|
|
105
|
+
[](https://pypi.org/project/eegdash/)
|
|
106
|
+
[](https://pepy.tech/project/eegdash)
|
|
107
|
+
<!-- [](https://codecov.io/gh/sccn/eegdash) -->
|
|
108
|
+
|
|
101
109
|
To leverage recent and ongoing advancements in large-scale computational methods and to ensure the preservation of scientific data generated from publicly funded research, the EEG-DaSh data archive will create a data-sharing resource for MEEG (EEG, MEG) data contributed by collaborators for machine learning (ML) and deep learning (DL) applications.
|
|
102
110
|
|
|
103
111
|
## Data source
|
|
@@ -143,7 +151,9 @@ To use the data from a single subject, enter:
|
|
|
143
151
|
from eegdash import EEGDashDataset
|
|
144
152
|
|
|
145
153
|
ds_NDARDB033FW5 = EEGDashDataset(
|
|
146
|
-
{"dataset": "ds005514", "task":
|
|
154
|
+
{"dataset": "ds005514", "task":
|
|
155
|
+
"RestingState", "subject": "NDARDB033FW5"},
|
|
156
|
+
cache_dir="."
|
|
147
157
|
)
|
|
148
158
|
```
|
|
149
159
|
|
|
@@ -155,7 +165,7 @@ To use the data from multiple subjects, enter:
|
|
|
155
165
|
from eegdash import EEGDashDataset
|
|
156
166
|
|
|
157
167
|
ds_ds005505rest = EEGDashDataset(
|
|
158
|
-
{"dataset": "ds005505", "task": "RestingState"}, target_name="sex"
|
|
168
|
+
{"dataset": "ds005505", "task": "RestingState"}, target_name="sex", cache_dir=".
|
|
159
169
|
)
|
|
160
170
|
```
|
|
161
171
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import time
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
|
|
3
4
|
import pytest
|
|
4
5
|
|
|
@@ -10,9 +11,14 @@ FILES_PER_RELEASE = [1342, 1405, 1812, 3342, 3326, 1227, 3100, 2320, 2885, 2516,
|
|
|
10
11
|
|
|
11
12
|
RELEASE_FILES = list(zip(RELEASES, FILES_PER_RELEASE))
|
|
12
13
|
|
|
14
|
+
CACHE_DIR = (Path.home() / "mne_data" / "eeg_challenge_cache").resolve()
|
|
15
|
+
print()
|
|
16
|
+
print(CACHE_DIR)
|
|
17
|
+
CACHE_DIR.mkdir(parents=True, exist_ok=True)
|
|
18
|
+
|
|
13
19
|
|
|
14
20
|
def _load_release(release):
|
|
15
|
-
ds = EEGChallengeDataset(release=release)
|
|
21
|
+
ds = EEGChallengeDataset(release=release, cache_dir=CACHE_DIR)
|
|
16
22
|
getattr(ds, "description", None)
|
|
17
23
|
return ds
|
|
18
24
|
|
|
@@ -27,7 +33,7 @@ def warmed_mongo():
|
|
|
27
33
|
|
|
28
34
|
def test_eeg_challenge_dataset_initialization():
|
|
29
35
|
"""Test the initialization of EEGChallengeDataset."""
|
|
30
|
-
dataset = EEGChallengeDataset(release="R5")
|
|
36
|
+
dataset = EEGChallengeDataset(release="R5", cache_dir=CACHE_DIR)
|
|
31
37
|
|
|
32
38
|
release = "R5"
|
|
33
39
|
expected_bucket_prefix = f"s3://nmdatasets/NeurIPS25/{release}_L100"
|
|
@@ -56,7 +62,7 @@ def test_eeg_challenge_dataset_initialization():
|
|
|
56
62
|
|
|
57
63
|
@pytest.mark.parametrize("release, number_files", RELEASE_FILES)
|
|
58
64
|
def test_eeg_challenge_dataset_amount_files(release, number_files):
|
|
59
|
-
dataset = EEGChallengeDataset(release=release)
|
|
65
|
+
dataset = EEGChallengeDataset(release=release, cache_dir=CACHE_DIR)
|
|
60
66
|
assert len(dataset.datasets) == number_files
|
|
61
67
|
|
|
62
68
|
|
|
@@ -64,6 +70,7 @@ def test_eeg_challenge_dataset_amount_files(release, number_files):
|
|
|
64
70
|
def test_mongodb_load_benchmark(benchmark, warmed_mongo, release):
|
|
65
71
|
# Group makes the report nicer when comparing releases
|
|
66
72
|
benchmark.group = "EEGChallengeDataset.load"
|
|
73
|
+
|
|
67
74
|
result = benchmark.pedantic(
|
|
68
75
|
_load_release,
|
|
69
76
|
args=(release,),
|
|
@@ -71,18 +78,23 @@ def test_mongodb_load_benchmark(benchmark, warmed_mongo, release):
|
|
|
71
78
|
rounds=5, # take min/median across several cold-ish runs
|
|
72
79
|
warmup_rounds=1, # do one warmup round
|
|
73
80
|
)
|
|
81
|
+
|
|
74
82
|
assert result is not None
|
|
75
83
|
|
|
76
84
|
|
|
77
85
|
@pytest.mark.parametrize("release", RELEASES)
|
|
78
|
-
def
|
|
86
|
+
def test_mongodb_load_under_sometime(release):
|
|
79
87
|
start_time = time.perf_counter()
|
|
80
|
-
_ = EEGChallengeDataset(release=release)
|
|
88
|
+
_ = EEGChallengeDataset(release=release, cache_dir=CACHE_DIR)
|
|
81
89
|
duration = time.perf_counter() - start_time
|
|
82
90
|
assert duration < 30, f"{release} took {duration:.2f}s"
|
|
83
91
|
|
|
84
92
|
|
|
85
93
|
def test_consuming_data_r5():
|
|
86
|
-
dataset_obj = EEGChallengeDataset(
|
|
94
|
+
dataset_obj = EEGChallengeDataset(
|
|
95
|
+
release="R5",
|
|
96
|
+
query=dict(task="RestingState", subject="NDARAC350XUM"),
|
|
97
|
+
cache_dir=CACHE_DIR,
|
|
98
|
+
)
|
|
87
99
|
raw = dataset_obj.datasets[0].raw
|
|
88
100
|
assert raw is not None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|