eegdash 0.4.0.dev171__tar.gz → 0.4.0.dev176__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.

Files changed (77) hide show
  1. {eegdash-0.4.0.dev171/eegdash.egg-info → eegdash-0.4.0.dev176}/PKG-INFO +5 -3
  2. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/_templates/autosummary/module.rst +16 -0
  3. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/conf.py +115 -1
  4. eegdash-0.4.0.dev176/docs/source/dataset_summary/treemap.rst +19 -0
  5. eegdash-0.4.0.dev176/docs/source/dataset_summary.rst +99 -0
  6. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/__init__.py +1 -1
  7. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/data_utils.py +11 -3
  8. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/datasets.py +5 -0
  9. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/decorators.py +8 -0
  10. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/extractors.py +9 -0
  11. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/signal.py +11 -10
  12. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/utils.py +8 -0
  13. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/inspect.py +8 -0
  14. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/serialization.py +5 -1
  15. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/utils.py +5 -0
  16. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176/eegdash.egg-info}/PKG-INFO +5 -3
  17. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash.egg-info/SOURCES.txt +1 -0
  18. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash.egg-info/requires.txt +5 -2
  19. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/pyproject.toml +6 -2
  20. eegdash-0.4.0.dev171/docs/source/dataset_summary.rst +0 -40
  21. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/LICENSE +0 -0
  22. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/MANIFEST.in +0 -0
  23. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/README.md +0 -0
  24. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/Makefile +0 -0
  25. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/api/api.rst +0 -0
  26. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/api/api_core.rst +0 -0
  27. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/api/api_features.rst +0 -0
  28. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/dataset_summary/bubble.rst +0 -0
  29. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/dataset_summary/kde.rst +0 -0
  30. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/dataset_summary/sankey.rst +0 -0
  31. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/dataset_summary/table.rst +0 -0
  32. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/index.rst +0 -0
  33. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/install/install.rst +0 -0
  34. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/install/install_pip.rst +0 -0
  35. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/install/install_source.rst +0 -0
  36. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/sg_execution_times.rst +0 -0
  37. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/docs/source/user_guide.rst +0 -0
  38. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/api.py +0 -0
  39. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/bids_eeg_metadata.py +0 -0
  40. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/const.py +0 -0
  41. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/dataset/__init__.py +0 -0
  42. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/dataset/dataset.py +0 -0
  43. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/dataset/dataset_summary.csv +0 -0
  44. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/dataset/registry.py +0 -0
  45. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/downloader.py +0 -0
  46. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/__init__.py +0 -0
  47. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/__init__.py +0 -0
  48. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/complexity.py +0 -0
  49. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/connectivity.py +0 -0
  50. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/csp.py +0 -0
  51. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/dimensionality.py +0 -0
  52. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/features/feature_bank/spectral.py +0 -0
  53. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/hbn/__init__.py +0 -0
  54. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/hbn/preprocessing.py +0 -0
  55. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/hbn/windows.py +0 -0
  56. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/logging.py +0 -0
  57. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/mongodb.py +0 -0
  58. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/paths.py +0 -0
  59. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash/utils.py +0 -0
  60. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash.egg-info/dependency_links.txt +0 -0
  61. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/eegdash.egg-info/top_level.txt +0 -0
  62. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/setup.cfg +0 -0
  63. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_api.py +0 -0
  64. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_bids_dependencies.py +0 -0
  65. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_cache_folder_suffix.py +0 -0
  66. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_challenge_kwargs.py +0 -0
  67. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_correctness.py +0 -0
  68. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_dataset.py +0 -0
  69. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_dataset_registration.py +0 -0
  70. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_downloader.py +0 -0
  71. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_eegdash.py +0 -0
  72. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_features.py +0 -0
  73. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_init.py +0 -0
  74. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_minirelease.py +0 -0
  75. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_mongo_connection.py +0 -0
  76. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_offline.py +0 -0
  77. {eegdash-0.4.0.dev171 → eegdash-0.4.0.dev176}/tests/test_query.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eegdash
3
- Version: 0.4.0.dev171
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
@@ -63,3 +63,19 @@
63
63
  {% endif %}
64
64
  {%- endblock %}
65
65
 
66
+ {% if sg_api_usage %}
67
+ .. _sg_api_{{ fullname }}:
68
+
69
+ API Usage
70
+ ---------
71
+
72
+ .. raw:: html
73
+
74
+ <div class="sg-api-usage">
75
+
76
+ {{ sg_api_usage }}
77
+
78
+ .. raw:: html
79
+
80
+ </div>
81
+ {% endif %}
@@ -2,6 +2,7 @@ import csv
2
2
  import importlib
3
3
  import inspect
4
4
  import os
5
+ import shutil
5
6
  import sys
6
7
  from collections import Counter
7
8
  from datetime import datetime, timezone
@@ -78,6 +79,7 @@ html_css_files = [
78
79
  "https://cdn.datatables.net/select/1.7.0/css/select.dataTables.min.css",
79
80
  "https://cdn.datatables.net/searchpanes/2.3.1/css/searchPanes.dataTables.min.css",
80
81
  "custom.css",
82
+ "css/treemap.css",
81
83
  ]
82
84
  html_js_files = [
83
85
  "https://code.jquery.com/jquery-3.7.1.min.js",
@@ -221,11 +223,21 @@ EX_DIR = "../../examples" # relative to docs/source
221
223
  sphinx_gallery_conf = {
222
224
  "examples_dirs": [f"{EX_DIR}"],
223
225
  "gallery_dirs": ["generated/auto_examples"],
226
+ "binder": {
227
+ "org": "sccn",
228
+ "repo": "EEGDash",
229
+ "branch": "main",
230
+ "binderhub_url": "https://mybinder.org",
231
+ "dependencies": "binder/requirements.txt",
232
+ "notebooks_dir": "notebooks",
233
+ "use_jupyter_lab": True,
234
+ },
235
+ "capture_repr": ("_repr_html_", "__repr__"),
224
236
  "nested_sections": False,
225
237
  "backreferences_dir": "gen_modules/backreferences",
226
238
  "inspect_global_variables": True,
227
239
  "show_memory": True,
228
- "show_api_usage": False,
240
+ "show_api_usage": True,
229
241
  "doc_module": ("eegdash", "numpy", "scipy", "matplotlib"),
230
242
  "reference_url": {"eegdash": None},
231
243
  "filename_pattern": r"/(?:plot|tutorial)_(?!_).*\.py",
@@ -602,6 +614,106 @@ def _generate_dataset_docs(app) -> None:
602
614
  continue
603
615
 
604
616
 
617
+ def _split_tokens(value: str | None) -> set[str]:
618
+ tokens: set[str] = set()
619
+ if not value:
620
+ return tokens
621
+ for part in value.split(","):
622
+ cleaned = part.strip()
623
+ if cleaned:
624
+ tokens.add(cleaned)
625
+ return tokens
626
+
627
+
628
+ def _compute_dataset_counter_defaults() -> dict[str, int]:
629
+ csv_path = Path(importlib.import_module("eegdash.dataset").__file__).with_name(
630
+ "dataset_summary.csv"
631
+ )
632
+ if not csv_path.exists():
633
+ return {}
634
+
635
+ dataset_ids: set[str] = set()
636
+ modalities: set[str] = set()
637
+ cognitive: set[str] = set()
638
+ subject_total = 0
639
+
640
+ with csv_path.open(encoding="utf-8") as handle:
641
+ filtered = (
642
+ line
643
+ for line in handle
644
+ if line.strip() and not line.lstrip().startswith("#")
645
+ )
646
+ reader = csv.DictReader(filtered)
647
+ for row in reader:
648
+ dataset = (row.get("dataset") or row.get("Dataset") or "").strip()
649
+ if dataset:
650
+ dataset_ids.add(dataset)
651
+
652
+ try:
653
+ subject_total += int(float(row.get("n_subjects", "0") or 0))
654
+ except (TypeError, ValueError):
655
+ pass
656
+
657
+ modalities.update(_split_tokens(row.get("record_modality")))
658
+ cognitive.update(_split_tokens(row.get("type of exp")))
659
+
660
+ return {
661
+ "datasets": len(dataset_ids),
662
+ "subjects": subject_total,
663
+ "modalities": len(modalities),
664
+ "cognitive": len(cognitive),
665
+ }
666
+
667
+
668
+ _DATASET_COUNTER_DEFAULTS = _compute_dataset_counter_defaults()
669
+
670
+
671
+ def _format_counter(key: str) -> str:
672
+ value = _DATASET_COUNTER_DEFAULTS.get(key, 0)
673
+ if isinstance(value, (int, float)):
674
+ if isinstance(value, float) and not value.is_integer():
675
+ return f"{value:,.2f}"
676
+ return f"{int(value):,}"
677
+ return str(value)
678
+
679
+
680
+ _DATASET_COUNTER_PLACEHOLDERS = {
681
+ "|datasets_total|": _format_counter("datasets"),
682
+ "|subjects_total|": _format_counter("subjects"),
683
+ "|modalities_total|": _format_counter("modalities"),
684
+ "|cognitive_total|": _format_counter("cognitive"),
685
+ }
686
+
687
+
688
+ def _copy_dataset_summary(app, exception) -> None:
689
+ if exception is not None or not getattr(app, "builder", None):
690
+ return
691
+
692
+ csv_path = Path(importlib.import_module("eegdash.dataset").__file__).with_name(
693
+ "dataset_summary.csv"
694
+ )
695
+ if not csv_path.exists():
696
+ LOGGER.warning("dataset_summary.csv not found; skipping counter data copy.")
697
+ return
698
+
699
+ static_dir = Path(app.outdir) / "_static"
700
+ try:
701
+ static_dir.mkdir(parents=True, exist_ok=True)
702
+ shutil.copy2(csv_path, static_dir / "dataset_summary.csv")
703
+ except OSError as exc:
704
+ LOGGER.warning("Unable to copy dataset_summary.csv to _static: %s", exc)
705
+
706
+
707
+ def _inject_counter_values(app, docname, source) -> None:
708
+ if docname != "dataset_summary":
709
+ return
710
+
711
+ text = source[0]
712
+ for token, value in _DATASET_COUNTER_PLACEHOLDERS.items():
713
+ text = text.replace(token, value)
714
+ source[0] = text
715
+
716
+
605
717
  def setup(app):
606
718
  """Create the back-references directory if it doesn't exist."""
607
719
  backreferences_dir = os.path.join(
@@ -611,6 +723,8 @@ def setup(app):
611
723
  os.makedirs(backreferences_dir)
612
724
 
613
725
  app.connect("builder-inited", _generate_dataset_docs)
726
+ app.connect("build-finished", _copy_dataset_summary)
727
+ app.connect("source-read", _inject_counter_values)
614
728
 
615
729
 
616
730
  # Configure sitemap URL format (omit .html where possible)
@@ -0,0 +1,19 @@
1
+ .. title:: Dataset treemap
2
+
3
+ .. rubric:: Dataset treemap
4
+
5
+ .. raw:: html
6
+
7
+ <figure class="eegdash-figure" style="margin: 0 0 1.25rem 0;">
8
+
9
+ .. raw:: html
10
+ :file: ../_static/dataset_generated/dataset_treemap.html
11
+
12
+ .. raw:: html
13
+
14
+ <figcaption class="eegdash-caption">
15
+ Figure: Treemap of EEG Dash datasets. The top level groups population type,
16
+ the second level breaks down experimental modality, and leaves list individual datasets.
17
+ Tile area encodes the total number of subjects; hover to view aggregated hours (or records when unavailable).
18
+ </figcaption>
19
+ </figure>
@@ -0,0 +1,99 @@
1
+ :hide_sidebar: true
2
+ :html_theme.sidebar_secondary.remove: true
3
+ :html_theme.sidebar_primary.remove: true
4
+
5
+ .. _data_summary:
6
+
7
+ .. raw:: html
8
+
9
+ <script>document.documentElement.classList.add('dataset-summary-page');</script>
10
+
11
+ .. rst-class:: dataset-summary-article
12
+
13
+ Datasets Catalog
14
+ ================
15
+
16
+ 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.
17
+
18
+ .. raw:: html
19
+
20
+ <section class="dataset-counter-grid">
21
+ <article class="dataset-counter-card">
22
+ <div class="dataset-counter-icon" aria-hidden="true">
23
+ <svg class="dataset-counter-svg" viewBox="0 0 24 24" role="presentation" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
24
+ <ellipse cx="12" cy="5" rx="7" ry="3"></ellipse>
25
+ <path d="M5 5v10c0 1.66 3.13 3 7 3s7-1.34 7-3V5"></path>
26
+ <path d="M5 12c0 1.66 3.13 3 7 3s7-1.34 7-3"></path>
27
+ </svg>
28
+ </div>
29
+ <div class="dataset-counter-body">
30
+ <span class="dataset-counter-label">Datasets</span>
31
+ <span class="dataset-counter-value">|datasets_total|</span>
32
+ </div>
33
+ </article>
34
+ <article class="dataset-counter-card">
35
+ <div class="dataset-counter-icon" aria-hidden="true">
36
+ <svg class="dataset-counter-svg" viewBox="0 0 24 24" role="presentation" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
37
+ <circle cx="8" cy="9" r="3"></circle>
38
+ <circle cx="16" cy="9" r="3"></circle>
39
+ <path d="M4 19c0-3 2.24-5 4-5s4 2 4 5"></path>
40
+ <path d="M12 19c0-3 2.24-5 4-5s4 2 4 5"></path>
41
+ </svg>
42
+ </div>
43
+ <div class="dataset-counter-body">
44
+ <span class="dataset-counter-label">Subjects</span>
45
+ <span class="dataset-counter-value">|subjects_total|</span>
46
+ </div>
47
+ </article>
48
+ <article class="dataset-counter-card">
49
+ <div class="dataset-counter-icon" aria-hidden="true">
50
+ <svg class="dataset-counter-svg" viewBox="0 0 24 24" role="presentation" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
51
+ <path d="M3 15c2.5 0 2.5-6 5-6s2.5 6 5 6 2.5-6 5-6 2.5 6 5 6"></path>
52
+ <path d="M3 9c2.5 0 2.5-5 5-5s2.5 5 5 5 2.5-5 5-5 2.5 5 5 5"></path>
53
+ </svg>
54
+ </div>
55
+ <div class="dataset-counter-body">
56
+ <span class="dataset-counter-label">Experiment Modalities</span>
57
+ <span class="dataset-counter-value">|modalities_total|</span>
58
+ </div>
59
+ </article>
60
+ <article class="dataset-counter-card">
61
+ <div class="dataset-counter-icon" aria-hidden="true">
62
+ <svg class="dataset-counter-svg" viewBox="0 0 24 24" role="presentation" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
63
+ <path d="M12 4c-3.5 0-7 2-7 6 0 3.5 2.5 6 6 6v4l3-2 3 2v-4c2.5 0 4-2 4-5 0-3.5-2.5-7-9-7z"></path>
64
+ </svg>
65
+ </div>
66
+ <div class="dataset-counter-body">
67
+ <span class="dataset-counter-label">Cognitive Domains</span>
68
+ <span class="dataset-counter-value">|cognitive_total|</span>
69
+ </div>
70
+ </article>
71
+ </section>
72
+
73
+ .. raw:: html
74
+
75
+ <script src="https://cdn.plot.ly/plotly-3.1.0.min.js"></script>
76
+
77
+ .. tab-set::
78
+
79
+ .. tab-item:: Dataset Table
80
+
81
+ .. include:: dataset_summary/table.rst
82
+
83
+ .. tab-item:: Participant Distribution
84
+
85
+ .. include:: dataset_summary/kde.rst
86
+
87
+ .. tab-item:: Dataset Flow
88
+
89
+ .. include:: dataset_summary/sankey.rst
90
+
91
+ .. tab-item:: Dataset Treemap
92
+
93
+ .. include:: dataset_summary/treemap.rst
94
+
95
+ .. tab-item:: Scatter of Sample Size vs. Recording Duration
96
+
97
+ .. include:: dataset_summary/bubble.rst
98
+
99
+ The archive is currently still in :bdg-danger:`beta testing` mode, so be kind.
@@ -18,4 +18,4 @@ _init_mongo_client()
18
18
 
19
19
  __all__ = ["EEGDash", "EEGDashDataset", "EEGChallengeDataset", "preprocessing"]
20
20
 
21
- __version__ = "0.4.0.dev171"
21
+ __version__ = "0.4.0.dev176"
@@ -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: BIDSLayout) -> list[str]:
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():
@@ -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.
@@ -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.
@@ -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
- "signal_mean",
12
- "signal_variance",
13
- "signal_skewness",
11
+ "SIGNAL_PREDECESSORS",
12
+ "signal_decorrelation_time",
13
+ "signal_hjorth_activity",
14
+ "signal_hjorth_complexity",
15
+ "signal_hjorth_mobility",
14
16
  "signal_kurtosis",
15
- "signal_std",
16
- "signal_root_mean_square",
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
 
@@ -1,5 +1,13 @@
1
1
  import numpy as np
2
2
 
3
+ __all__ = [
4
+ "DEFAULT_FREQ_BANDS",
5
+ "get_valid_freq_band",
6
+ "reduce_freq_bands",
7
+ "slice_freq_band",
8
+ ]
9
+
10
+
3
11
  DEFAULT_FREQ_BANDS = {
4
12
  "delta": (1, 4.5),
5
13
  "theta": (4.5, 8),
@@ -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//blob/master/braindecode/datautil/serialization.py#L165-L229
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
@@ -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.dev171
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
@@ -16,6 +16,7 @@ docs/source/dataset_summary/bubble.rst
16
16
  docs/source/dataset_summary/kde.rst
17
17
  docs/source/dataset_summary/sankey.rst
18
18
  docs/source/dataset_summary/table.rst
19
+ docs/source/dataset_summary/treemap.rst
19
20
  docs/source/install/install.rst
20
21
  docs/source/install/install_pip.rst
21
22
  docs/source/install/install_source.rst
@@ -3,11 +3,9 @@ mne_bids>=0.17.0
3
3
  numba
4
4
  numpy
5
5
  pandas
6
- pybids
7
6
  pymongo
8
7
  python-dotenv
9
8
  s3fs
10
- scipy
11
9
  tqdm
12
10
  h5io>=0.2.4
13
11
  pymatreader
@@ -20,11 +18,15 @@ rich
20
18
  eegdash[docs]
21
19
  eegdash[dev]
22
20
  eegdash[tests]
21
+ eegdash[digestion]
23
22
 
24
23
  [dev]
25
24
  pre-commit
26
25
  ipykernel
27
26
 
27
+ [digestion]
28
+ pybids
29
+
28
30
  [docs]
29
31
  sphinx
30
32
  sphinx_design
@@ -45,6 +47,7 @@ graphviz
45
47
  [tests]
46
48
  pytest
47
49
  pytest-cov
50
+ pytest-sugar
48
51
  codecov
49
52
  pytest_cases
50
53
  pytest-benchmark
@@ -40,11 +40,9 @@ dependencies = [
40
40
  "numba",
41
41
  "numpy",
42
42
  "pandas",
43
- "pybids",
44
43
  "pymongo",
45
44
  "python-dotenv",
46
45
  "s3fs",
47
- "scipy",
48
46
  "tqdm",
49
47
  "h5io >= 0.2.4",
50
48
  "pymatreader",
@@ -63,6 +61,7 @@ Issues = "https://github.com/sccn/EEG-Dash-Data/issues"
63
61
  tests = [
64
62
  'pytest',
65
63
  'pytest-cov',
64
+ 'pytest-sugar',
66
65
  'codecov',
67
66
  'pytest_cases',
68
67
  'pytest-benchmark',
@@ -90,10 +89,15 @@ docs = [
90
89
  "graphviz",
91
90
  ]
92
91
 
92
+ digestion = [
93
+ "pybids",
94
+ ]
95
+
93
96
  all = [
94
97
  "eegdash[docs]",
95
98
  "eegdash[dev]",
96
99
  "eegdash[tests]",
100
+ "eegdash[digestion]",
97
101
  ]
98
102
 
99
103
  [tool.setuptools]
@@ -1,40 +0,0 @@
1
- :hide_sidebar: true
2
- :html_theme.sidebar_secondary.remove: true
3
- :html_theme.sidebar_primary.remove: true
4
-
5
- .. _data_summary:
6
-
7
- .. raw:: html
8
-
9
- <script>document.documentElement.classList.add('dataset-summary-page');</script>
10
-
11
- .. rst-class:: dataset-summary-article
12
-
13
- Datasets Catalog
14
- ================
15
-
16
- 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.
17
-
18
- .. raw:: html
19
-
20
- <script src="https://cdn.plot.ly/plotly-3.1.0.min.js"></script>
21
-
22
- .. tab-set::
23
-
24
- .. tab-item:: Dataset Table
25
-
26
- .. include:: dataset_summary/table.rst
27
-
28
- .. tab-item:: Participant Distribution
29
-
30
- .. include:: dataset_summary/kde.rst
31
-
32
- .. tab-item:: Dataset Flow
33
-
34
- .. include:: dataset_summary/sankey.rst
35
-
36
- .. tab-item:: Scatter of Sample Size vs. Recording Duration
37
-
38
- .. include:: dataset_summary/bubble.rst
39
-
40
- The archive is currently still in :bdg-danger:`beta testing` mode, so be kind.
File without changes
File without changes
File without changes