eegdash 0.3.9.dev170082126__py3-none-any.whl → 0.4.0__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 +12 -1
- eegdash/api.py +297 -295
- eegdash/bids_eeg_metadata.py +297 -56
- eegdash/const.py +43 -0
- eegdash/data_utils.py +327 -430
- eegdash/dataset/__init__.py +19 -1
- eegdash/dataset/dataset.py +61 -33
- eegdash/dataset/dataset_summary.csv +255 -256
- eegdash/dataset/registry.py +163 -11
- eegdash/downloader.py +197 -0
- eegdash/features/datasets.py +323 -138
- eegdash/features/decorators.py +88 -3
- eegdash/features/extractors.py +203 -55
- eegdash/features/feature_bank/complexity.py +7 -3
- eegdash/features/feature_bank/dimensionality.py +1 -1
- eegdash/features/inspect.py +80 -5
- eegdash/features/serialization.py +49 -17
- eegdash/features/utils.py +75 -8
- eegdash/hbn/__init__.py +11 -0
- eegdash/hbn/preprocessing.py +61 -19
- eegdash/hbn/windows.py +157 -34
- eegdash/logging.py +54 -0
- eegdash/mongodb.py +55 -24
- eegdash/paths.py +28 -5
- eegdash/utils.py +29 -1
- {eegdash-0.3.9.dev170082126.dist-info → eegdash-0.4.0.dist-info}/METADATA +11 -59
- eegdash-0.4.0.dist-info/RECORD +37 -0
- eegdash-0.3.9.dev170082126.dist-info/RECORD +0 -35
- {eegdash-0.3.9.dev170082126.dist-info → eegdash-0.4.0.dist-info}/WHEEL +0 -0
- {eegdash-0.3.9.dev170082126.dist-info → eegdash-0.4.0.dist-info}/licenses/LICENSE +0 -0
- {eegdash-0.3.9.dev170082126.dist-info → eegdash-0.4.0.dist-info}/top_level.txt +0 -0
eegdash/dataset/__init__.py
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
"""Public API for dataset helpers and dynamically generated datasets."""
|
|
2
|
+
|
|
3
|
+
from . import dataset as _dataset_mod # triggers dynamic class registration
|
|
1
4
|
from .dataset import EEGChallengeDataset
|
|
2
5
|
from .registry import register_openneuro_datasets
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
# Re-export dynamically generated dataset classes at the package level so that
|
|
8
|
+
# ``eegdash.dataset`` shows them in the API docs and users can import as
|
|
9
|
+
# ``from eegdash.dataset import DSXXXXX``.
|
|
10
|
+
_dyn_names = []
|
|
11
|
+
for _name in getattr(_dataset_mod, "__all__", []):
|
|
12
|
+
if _name == "EEGChallengeDataset":
|
|
13
|
+
# Already imported explicitly above
|
|
14
|
+
continue
|
|
15
|
+
_obj = getattr(_dataset_mod, _name, None)
|
|
16
|
+
if _obj is not None:
|
|
17
|
+
globals()[_name] = _obj
|
|
18
|
+
_dyn_names.append(_name)
|
|
19
|
+
|
|
20
|
+
__all__ = ["EEGChallengeDataset", "register_openneuro_datasets"] + _dyn_names
|
|
21
|
+
|
|
22
|
+
del _dataset_mod, _name, _obj, _dyn_names
|
eegdash/dataset/dataset.py
CHANGED
|
@@ -1,39 +1,59 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
from pathlib import Path
|
|
3
2
|
|
|
4
|
-
from
|
|
3
|
+
from rich.console import Console
|
|
4
|
+
from rich.panel import Panel
|
|
5
|
+
from rich.text import Text
|
|
5
6
|
|
|
6
7
|
from ..api import EEGDashDataset
|
|
7
8
|
from ..bids_eeg_metadata import build_query_from_kwargs
|
|
8
9
|
from ..const import RELEASE_TO_OPENNEURO_DATASET_MAP, SUBJECT_MINI_RELEASE_MAP
|
|
10
|
+
from ..logging import logger
|
|
9
11
|
from .registry import register_openneuro_datasets
|
|
10
12
|
|
|
11
|
-
logger = logging.getLogger("eegdash")
|
|
12
|
-
|
|
13
13
|
|
|
14
14
|
class EEGChallengeDataset(EEGDashDataset):
|
|
15
|
-
"""EEG 2025 Challenge
|
|
15
|
+
"""A dataset helper for the EEG 2025 Challenge.
|
|
16
16
|
|
|
17
|
-
This class
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
This class simplifies access to the EEG 2025 Challenge datasets. It is a
|
|
18
|
+
specialized version of :class:`~eegdash.api.EEGDashDataset` that is
|
|
19
|
+
pre-configured for the challenge's data releases. It automatically maps a
|
|
20
|
+
release name (e.g., "R1") to the corresponding OpenNeuro dataset and handles
|
|
21
|
+
the selection of subject subsets (e.g., "mini" release).
|
|
21
22
|
|
|
22
23
|
Parameters
|
|
23
24
|
----------
|
|
24
25
|
release : str
|
|
25
|
-
|
|
26
|
+
The name of the challenge release to load. Must be one of the keys in
|
|
27
|
+
:const:`~eegdash.const.RELEASE_TO_OPENNEURO_DATASET_MAP`
|
|
28
|
+
(e.g., "R1", "R2", ..., "R11").
|
|
26
29
|
cache_dir : str
|
|
27
|
-
|
|
30
|
+
The local directory where the dataset will be downloaded and cached.
|
|
28
31
|
mini : bool, default True
|
|
29
|
-
If True,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
If True, the dataset is restricted to the official "mini" subset of
|
|
33
|
+
subjects for the specified release. If False, all subjects for the
|
|
34
|
+
release are included.
|
|
35
|
+
query : dict, optional
|
|
36
|
+
An additional MongoDB-style query to apply as a filter. This query is
|
|
37
|
+
combined with the release and subject filters using a logical AND.
|
|
38
|
+
The query must not contain the ``dataset`` key, as this is determined
|
|
39
|
+
by the ``release`` parameter.
|
|
40
|
+
s3_bucket : str, optional
|
|
41
|
+
The base S3 bucket URI where the challenge data is stored. Defaults to
|
|
42
|
+
the official challenge bucket.
|
|
35
43
|
**kwargs
|
|
36
|
-
|
|
44
|
+
Additional keyword arguments that are passed directly to the
|
|
45
|
+
:class:`~eegdash.api.EEGDashDataset` constructor.
|
|
46
|
+
|
|
47
|
+
Raises
|
|
48
|
+
------
|
|
49
|
+
ValueError
|
|
50
|
+
If the specified ``release`` is unknown, or if the ``query`` argument
|
|
51
|
+
contains a ``dataset`` key. Also raised if ``mini`` is True and a
|
|
52
|
+
requested subject is not part of the official mini-release subset.
|
|
53
|
+
|
|
54
|
+
See Also
|
|
55
|
+
--------
|
|
56
|
+
EEGDashDataset : The base class for creating datasets from queries.
|
|
37
57
|
|
|
38
58
|
"""
|
|
39
59
|
|
|
@@ -123,24 +143,32 @@ class EEGChallengeDataset(EEGDashDataset):
|
|
|
123
143
|
else:
|
|
124
144
|
s3_bucket = f"{s3_bucket}/{release}_L100_bdf"
|
|
125
145
|
|
|
126
|
-
|
|
127
|
-
"\n\n"
|
|
128
|
-
"[EEGChallengeDataset] EEG 2025 Competition Data Notice:\n"
|
|
129
|
-
"-------------------------------------------------------\n"
|
|
146
|
+
message_text = Text.from_markup(
|
|
130
147
|
"This object loads the HBN dataset that has been preprocessed for the EEG Challenge:\n"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"\n"
|
|
137
|
-
"IMPORTANT: The data accessed via `EEGChallengeDataset` is NOT identical to what you get from
|
|
138
|
-
"If you are participating in the competition, always use `EEGChallengeDataset` to ensure consistency with the challenge data
|
|
139
|
-
"\n",
|
|
140
|
-
UserWarning,
|
|
141
|
-
module="eegdash",
|
|
148
|
+
" * Downsampled from 500Hz to 100Hz\n"
|
|
149
|
+
" * Bandpass filtered (0.5-50 Hz)\n\n"
|
|
150
|
+
"For full preprocessing applied for competition details, see:\n"
|
|
151
|
+
" [link=https://github.com/eeg2025/downsample-datasets]https://github.com/eeg2025/downsample-datasets[/link]\n\n"
|
|
152
|
+
"The HBN dataset have some preprocessing applied by the HBN team:\n"
|
|
153
|
+
" * Re-reference (Cz Channel)\n\n"
|
|
154
|
+
"[bold red]IMPORTANT[/bold red]: The data accessed via `EEGChallengeDataset` is [u]NOT[/u] identical to what you get from [link=https://github.com/sccn/EEGDash/blob/develop/eegdash/api.py]EEGDashDataset[/link] directly.\n"
|
|
155
|
+
"If you are participating in the competition, always use `EEGChallengeDataset` to ensure consistency with the challenge data."
|
|
142
156
|
)
|
|
143
157
|
|
|
158
|
+
warning_panel = Panel(
|
|
159
|
+
message_text,
|
|
160
|
+
title="[yellow]EEG 2025 Competition Data Notice[/yellow]",
|
|
161
|
+
subtitle="[cyan]Source: EEGChallengeDataset[/cyan]",
|
|
162
|
+
border_style="yellow",
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# Render the panel directly to the console so it displays in IPython/terminals
|
|
166
|
+
try:
|
|
167
|
+
Console().print(warning_panel)
|
|
168
|
+
except Exception:
|
|
169
|
+
warning_message = str(message_text)
|
|
170
|
+
logger.warning(warning_message)
|
|
171
|
+
|
|
144
172
|
super().__init__(
|
|
145
173
|
dataset=RELEASE_TO_OPENNEURO_DATASET_MAP[release],
|
|
146
174
|
query=query,
|