eegdash 0.3.0.dev46__tar.gz → 0.3.1__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.0.dev46 → eegdash-0.3.1}/PKG-INFO +1 -1
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/__init__.py +1 -1
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/data_utils.py +19 -3
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/dataset.py +17 -17
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash.egg-info/PKG-INFO +1 -1
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/tests/test_dataset.py +8 -2
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/LICENSE +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/README.md +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/api.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/data_config.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/__init__.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/datasets.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/decorators.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/extractors.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/__init__.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/complexity.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/connectivity.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/csp.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/dimensionality.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/signal.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/spectral.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/feature_bank/utils.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/inspect.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/serialization.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/features/utils.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/mongodb.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/preprocessing.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash/utils.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash.egg-info/SOURCES.txt +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash.egg-info/dependency_links.txt +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash.egg-info/requires.txt +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/eegdash.egg-info/top_level.txt +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/pyproject.toml +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/setup.cfg +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/tests/test_correctness.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/tests/test_eegdash.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/tests/test_init.py +0 -0
- {eegdash-0.3.0.dev46 → eegdash-0.3.1}/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.1
|
|
4
4
|
Summary: EEG data for machine learning
|
|
5
5
|
Author-email: Young Truong <dt.young112@gmail.com>, Arnaud Delorme <adelorme@gmail.com>, Bruno Aristimunha <b.aristimunha@gmail.com>
|
|
6
6
|
License: GNU General Public License
|
|
@@ -6,7 +6,6 @@ from pathlib import Path
|
|
|
6
6
|
from typing import Any
|
|
7
7
|
|
|
8
8
|
import mne
|
|
9
|
-
import mne_bids
|
|
10
9
|
import numpy as np
|
|
11
10
|
import pandas as pd
|
|
12
11
|
import s3fs
|
|
@@ -62,10 +61,23 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
62
61
|
suffix="eeg",
|
|
63
62
|
**bids_kwargs,
|
|
64
63
|
)
|
|
65
|
-
|
|
64
|
+
if s3_bucket:
|
|
65
|
+
self.s3_bucket = s3_bucket
|
|
66
|
+
self.s3_open_neuro = False
|
|
67
|
+
else:
|
|
68
|
+
self.s3_bucket = self._AWS_BUCKET
|
|
69
|
+
self.s3_open_neuro = True
|
|
70
|
+
|
|
66
71
|
self.s3file = self.get_s3path(record["bidspath"])
|
|
67
72
|
self.filecache = self.cache_dir / record["bidspath"]
|
|
68
73
|
self.bids_dependencies = record["bidsdependencies"]
|
|
74
|
+
# Temporary fix for BIDS dependencies path
|
|
75
|
+
# just to release to the competition
|
|
76
|
+
if not self.s3_open_neuro:
|
|
77
|
+
self.bids_dependencies = [
|
|
78
|
+
dep.split("/", 1)[1] for dep in self.bids_dependencies
|
|
79
|
+
]
|
|
80
|
+
|
|
69
81
|
self._raw = None
|
|
70
82
|
|
|
71
83
|
def get_s3path(self, filepath: str) -> str:
|
|
@@ -78,6 +90,9 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
78
90
|
filesystem = s3fs.S3FileSystem(
|
|
79
91
|
anon=True, client_kwargs={"region_name": "us-east-2"}
|
|
80
92
|
)
|
|
93
|
+
if not self.s3_open_neuro:
|
|
94
|
+
self.s3file = re.sub(r"(^|/)ds\d{6}/", r"\1", self.s3file, count=1)
|
|
95
|
+
|
|
81
96
|
filesystem.download(self.s3file, self.filecache)
|
|
82
97
|
self.filenames = [self.filecache]
|
|
83
98
|
|
|
@@ -109,7 +124,7 @@ class EEGDashBaseDataset(BaseDataset):
|
|
|
109
124
|
self._download_dependencies()
|
|
110
125
|
self._download_s3()
|
|
111
126
|
if self._raw is None:
|
|
112
|
-
self._raw =
|
|
127
|
+
self._raw = mne.io.read_raw(fname=self.bidspath, verbose=False)
|
|
113
128
|
|
|
114
129
|
# === BaseDataset and PyTorch Dataset interface ===
|
|
115
130
|
|
|
@@ -216,6 +231,7 @@ class EEGDashBaseRaw(BaseRaw):
|
|
|
216
231
|
)
|
|
217
232
|
|
|
218
233
|
def get_s3path(self, filepath):
|
|
234
|
+
print(f"Getting S3 path for {filepath}")
|
|
219
235
|
return f"{self._AWS_BUCKET}/{filepath}"
|
|
220
236
|
|
|
221
237
|
def _download_s3(self):
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
from .api import EEGDashDataset
|
|
2
2
|
|
|
3
|
+
RELEASE_TO_OPENNEURO_DATASET_MAP = {
|
|
4
|
+
"R11": "ds005516",
|
|
5
|
+
"R10": "ds005515",
|
|
6
|
+
"R9": "ds005514",
|
|
7
|
+
"R8": "ds005512",
|
|
8
|
+
"R7": "ds005511",
|
|
9
|
+
"R6": "ds005510",
|
|
10
|
+
"R4": "ds005508",
|
|
11
|
+
"R5": "ds005509",
|
|
12
|
+
"R3": "ds005507",
|
|
13
|
+
"R2": "ds005506",
|
|
14
|
+
"R1": "ds005505",
|
|
15
|
+
}
|
|
16
|
+
|
|
3
17
|
|
|
4
18
|
class EEGChallengeDataset(EEGDashDataset):
|
|
5
19
|
def __init__(
|
|
@@ -7,7 +21,7 @@ class EEGChallengeDataset(EEGDashDataset):
|
|
|
7
21
|
release: str = "R5",
|
|
8
22
|
query: dict | None = None,
|
|
9
23
|
cache_dir: str = ".eegdash_cache",
|
|
10
|
-
s3_bucket: str | None = "s3://nmdatasets/NeurIPS25
|
|
24
|
+
s3_bucket: str | None = "s3://nmdatasets/NeurIPS25",
|
|
11
25
|
**kwargs,
|
|
12
26
|
):
|
|
13
27
|
"""Create a new EEGDashDataset from a given query or local BIDS dataset directory
|
|
@@ -32,25 +46,11 @@ class EEGChallengeDataset(EEGDashDataset):
|
|
|
32
46
|
constructor.
|
|
33
47
|
|
|
34
48
|
"""
|
|
35
|
-
dsnumber_release_map = {
|
|
36
|
-
"R11": "ds005516",
|
|
37
|
-
"R10": "ds005515",
|
|
38
|
-
"R9": "ds005514",
|
|
39
|
-
"R8": "ds005512",
|
|
40
|
-
"R7": "ds005511",
|
|
41
|
-
"R6": "ds005510",
|
|
42
|
-
"R4": "ds005508",
|
|
43
|
-
"R5": "ds005509",
|
|
44
|
-
"R3": "ds005507",
|
|
45
|
-
"R2": "ds005506",
|
|
46
|
-
"R1": "ds005505",
|
|
47
|
-
}
|
|
48
|
-
|
|
49
49
|
self.release = release
|
|
50
|
-
if release not in
|
|
50
|
+
if release not in RELEASE_TO_OPENNEURO_DATASET_MAP:
|
|
51
51
|
raise ValueError(f"Unknown release: {release}")
|
|
52
52
|
|
|
53
|
-
dataset =
|
|
53
|
+
dataset = RELEASE_TO_OPENNEURO_DATASET_MAP[release]
|
|
54
54
|
if query is None:
|
|
55
55
|
query = {"dataset": dataset}
|
|
56
56
|
elif "dataset" not in query:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eegdash
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: EEG data for machine learning
|
|
5
5
|
Author-email: Young Truong <dt.young112@gmail.com>, Arnaud Delorme <adelorme@gmail.com>, Bruno Aristimunha <b.aristimunha@gmail.com>
|
|
6
6
|
License: GNU General Public License
|
|
@@ -30,7 +30,7 @@ def test_eeg_challenge_dataset_initialization():
|
|
|
30
30
|
dataset = EEGChallengeDataset(release="R5")
|
|
31
31
|
|
|
32
32
|
release = "R5"
|
|
33
|
-
expected_bucket_prefix = f"s3://nmdatasets/NeurIPS25
|
|
33
|
+
expected_bucket_prefix = f"s3://nmdatasets/NeurIPS25/{release}_L100"
|
|
34
34
|
assert dataset.s3_bucket == expected_bucket_prefix, (
|
|
35
35
|
f"Unexpected s3_bucket: {dataset.s3_bucket} (expected {expected_bucket_prefix})"
|
|
36
36
|
)
|
|
@@ -79,4 +79,10 @@ def test_mongodb_load_under_slo(release):
|
|
|
79
79
|
start_time = time.perf_counter()
|
|
80
80
|
_ = EEGChallengeDataset(release=release)
|
|
81
81
|
duration = time.perf_counter() - start_time
|
|
82
|
-
assert duration <
|
|
82
|
+
assert duration < 30, f"{release} took {duration:.2f}s"
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def test_consuming_data_r5():
|
|
86
|
+
dataset_obj = EEGChallengeDataset(release="R5", query=dict(task="RestingState"))
|
|
87
|
+
raw = dataset_obj.datasets[0].raw
|
|
88
|
+
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
|
|
File without changes
|
|
File without changes
|