Skip to content

Commit

Permalink
Normalize dataset names (NeuroTechX#455)
Browse files Browse the repository at this point in the history
* Add depreciation decorator

* Update test_dataset_list

* Ignore aliases in test_dataset_list

* Add is_abreviation function

* Add tests for is_abreviation and is-camel-kebab_case

* Rename is_abbrev

* Fix dashes in is_abbrev

* Fix error message

* Update BNCI datasets names and codes

* Update mamem dataset codes

* Update epfl dataset code

* Update DeamonsP300 dataset code

* Test if codes are unique

* Update Huebner codes

* Relax is_abrev

* Update FakeDataset code

* Update code and name of Passive Head Mounted Display with Music Listening dataset

* Update name of GrosseWentrup2009

* Update code of Nakanishi2015

* Update name of SSVEPExo

* Update add argument suffix to Shin2017 and rename to BaseShin2017

* Update code of Sosulski2019

* Re-rename HeadMountedDisplay because colision with VR-P300

* Rename VirtualReality to Cattan2019_VR

* Add alias for VirtualReality

* Update code of Wand2016

* Update name of braininvaders datasets

* Add compound_dataset_list with test

* Del _init_dataset_list after usage

* Change names of bi-illeteracy datasets

* Fix hardcoded code test for Cattan2019-VR

* Fix benchmark test

* Update whats_new.rst

* Update BI2014b

Fixing the number of subjects in BI2014b.

* Update dataset summaries

* Fix case when note already present

* Fix forgotten change of BNCI2014001

* warn instead of raise when code and class name don't match (compatibility with depreciated names)

* Add test for depreciated datasets init

* Fix asserNoLogs only introduced in python3.10

* Specity test for depreciated warning

* Undo edit to old whats_new.rst lines

* Fix note formatting

* Update SSVEPExo name and code to Kalunga2016

---------

Co-authored-by: Bru <a.bruno@aluno.ufabc.edu.br>
Co-authored-by: Sara Sedlar <sara.sedlar@gmail.com>
  • Loading branch information
3 people committed Aug 19, 2023
1 parent 2d58584 commit d2e973d
Show file tree
Hide file tree
Showing 53 changed files with 756 additions and 383 deletions.
52 changes: 26 additions & 26 deletions docs/source/dataset_summary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Motor Imagery
:class: sortable

AlexMI,8,16,3,20,3s,512Hz,1,1,480
BNCI2014001,9,22,4,144,4s,250Hz,2,6,62208
BNCI2014002,14,15,2,80,5s,512Hz,1,8,17920
BNCI2014004,9,3,2,360,4.5s,250Hz,5,1,32400
BNCI2015001,12,13,2,200,5s,512Hz,3,1,14400
BNCI2015004,9,30,5,80,7s,256Hz,2,1,7200
BNCI2014_001,9,22,4,144,4s,250Hz,2,6,62208
BNCI2014_002,14,15,2,80,5s,512Hz,1,8,17920
BNCI2014_004,9,3,2,360,4.5s,250Hz,5,1,32400
BNCI2015_001,12,13,2,200,5s,512Hz,3,1,14400
BNCI2015_004,9,30,5,80,7s,256Hz,2,1,7200
Cho2017,52,64,2,100,3s,512Hz,1,1,9800
Lee2019_MI,55,62,2,100,4s,1000Hz,2,1,11000
MunichMI,10,128,2,150,7s,500Hz,1,1,3000
Lee2019_MI,54,62,2,100,4s,1000Hz,2,1,11000
GrosseWentrup2009,10,128,2,150,7s,500Hz,1,1,3000
Schirrmeister2017,14,128,4,120,4s,500Hz,1,2,13440
Ofner2017,15,61,7,60,3s,512Hz,1,10,63000
PhysionetMI,109,64,4,23,3s,160Hz,1,1,69760
Expand All @@ -44,19 +44,19 @@ P300/ERP
:header: Dataset, #Subj, #Chan, #Trials / class, Trials length, Sampling rate, #Sessions
:class: sortable

BNCI2014008, 8, 8, 3500 NT / 700 T, 1s, 256Hz, 1
BNCI2014009, 10, 16, 1440 NT / 288 T, 0.8s, 256Hz, 3
BNCI2015003, 10, 8, 1500 NT / 300 T, 0.8s, 256Hz, 1
bi2012, 25, 16, 6140 NT / 128 T, 1s, 512Hz, 2
bi2013a, 24, 16, 3200 NT / 640 T, 1s, 512Hz, 8 for subjects 1-7 else 1
bi2014a, 64, 16, 990 NT / 198 T, 1s, 512Hz, up to 3
bi2014b, 37, 32, 200 NT / 40 T, 1s, 512Hz, 3
bi2015a, 43, 32, 4131 NT / 825 T, 1s, 512Hz, 3
bi2015b, 44, 32, 2160 NT / 480 T, 1s, 512Hz, 2
VirtualReality, 21, 16, 600 NT / 120 T, 1s, 512Hz, 2
BNCI2014_008, 8, 8, 3500 NT / 700 T, 1s, 256Hz, 1
BNCI2014_009, 10, 16, 1440 NT / 288 T, 0.8s, 256Hz, 3
BNCI2015_003, 10, 8, 1500 NT / 300 T, 0.8s, 256Hz, 1
BI2012, 25, 16, 640 NT / 128 T, 1s, 128Hz, 2
BI2013a, 24, 16, 3200 NT / 640 T, 1s, 512Hz, 8 for subjects 1-7 else 1
BI2014a, 64, 16, 990 NT / 198 T, 1s, 512Hz, up to 3
BI2014b, 38, 32, 200 NT / 40 T, 1s, 512Hz, 3
BI2015a, 43, 32, 4131 NT / 825 T, 1s, 512Hz, 3
BI2015b, 44, 32, 2160 NT / 480 T, 1s, 512Hz, 1
Cattan2019_VR, 21, 16, 600 NT / 120 T, 1s, 512Hz, 2
Huebner2017, 13, 31, 364 NT / 112 T, 0.9s, 1000Hz, 3
Huebner2018, 12, 31, 364 NT / 112 T, 0.9s, 1000Hz, 3
Sosulski2019, 13, 31, 75 NT / 15 T, , 1000Hz, 3
Sosulski2019, 13, 31, 75 NT / 15 T, 1.2s, 1000Hz, 3
EPFLP300, 8, 32, 2753 NT / 551 T, 1s, 2048Hz, 4
Lee2019_ERP, 54, 62, 6900 NT / 1380 T, 1s, 1000Hz, 2

Expand All @@ -70,7 +70,7 @@ SSVEP
:class: sortable

Lee2019_SSVEP,54,16,4,25,1s,1000Hz,1
SSVEPExo,12,8,4,16,2s,256Hz,1
Kalunga2016,12,8,4,16,2s,256Hz,1
MAMEM1,10,256,5,12-15,3s,250Hz,1
MAMEM2,10,256,5,20-30,3s,250Hz,1
MAMEM3,10,14,4,20-30,3s,128Hz,1
Expand All @@ -89,7 +89,7 @@ is a resting state experiment.
:header: Dataset, #Subj, #Chan, #Classes, #Blocks / class, Trials length, Sampling rate, #Sessions
:class: sortable

HeadMountedDisplay,12,16,2,10,60s,512Hz,1
Cattan2019_PHMD,12,16,2,10,60s,512Hz,1


Compound Datasets
Expand All @@ -103,12 +103,12 @@ select a sample of subject inside a dataset (e.g. subject with high/low performa
:header: Dataset, #Subj, #Original datasets
:class: sortable

bi2014a_il,17,bi2014a
bi2014b_il,11,bi2014b
bi2015a_il,2,bi2015a
bi2015b_il,25,bi2015b
VirtualReality_il,4,VirtualReality
biIlliteracy,59,bi2014a_il bi2014b_il bi2015a_il bi2015b_il VirtualReality_il
BI2014a_Il,17,BI2014a
BI2014b_Il,11,BI2014b
BI2015a_Il,2,BI2015a
BI2015b_Il,25,BI2015b
Cattan2019_VR_Il,4,Cattan2019_VR
BI_Il,59,BI2014a_Il BI2014b_Il BI2015a_Il BI2015b_Il Cattan2019_VR_Il


Submit a new dataset
Expand Down
48 changes: 24 additions & 24 deletions docs/source/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Motor Imagery Datasets
:template: class.rst

AlexMI
BNCI2014001
BNCI2014002
BNCI2014004
BNCI2015001
BNCI2015004
BNCI2014_001
BNCI2014_002
BNCI2014_004
BNCI2015_001
BNCI2015_004
Cho2017
Lee2019_MI
MunichMI
GrosseWentrup2009
Ofner2017
PhysionetMI
Schirrmeister2017
Expand All @@ -40,16 +40,16 @@ ERP Datasets
:toctree: generated/
:template: class.rst

bi2012
bi2013a
bi2014a
bi2014b
bi2015a
bi2015b
VirtualReality
BNCI2014008
BNCI2014009
BNCI2015003
BI2012
BI2013a
BI2014a
BI2014b
BI2015a
BI2015b
Cattan2019_VR
BNCI2014_008
BNCI2014_009
BNCI2015_003
DemonsP300
EPFLP300
Huebner2017
Expand All @@ -66,7 +66,7 @@ SSVEP Datasets
:toctree: generated/
:template: class.rst

SSVEPExo
Kalunga2016
Nakanishi2015
Wang2016
MAMEM1
Expand All @@ -83,7 +83,7 @@ Resting State Datasets
:toctree: generated/
:template: class.rst

HeadMountedDisplay
Cattan2019_PHMD


------------
Expand Down Expand Up @@ -131,9 +131,9 @@ ERP Datasets
:toctree: generated/
:template: class.rst

bi2014a_il
bi2014b_il
bi2015a_il
bi2015b_il
VirtualReality_il
biIlliteracy
BI2014a_Il
BI2014b_Il
BI2015a_Il
BI2015b_Il
Cattan2019_VR_Il
BI_Il
4 changes: 4 additions & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Enhancements
- Allow :func:`moabb.datasets.utils.dataset_search` to search across paradigms ``paradigm=None`` (PR :gh:`408` by `Pierre Guetschel`_)
- Improving the review processing with more pre-commit bots (:gh:`435` by `Bruno Aristimunha`_)
- Update all dataset codes to remove white spaces and underscores (:gh:`448` by `Pierre Guetschel`_)
- Add :func:`moabb.utils.depreciated_alias` decorator (:gh:`455` by `Pierre Guetschel`_)
- Rename many dataset class names to standardize and deprecate old names (:gh:`455` by `Pierre Guetschel`_)
- Change many dataset codes to match the class names (:gh:`455` by `Pierre Guetschel`_)
- Add :obj:`moabb.datasets.compound_dataset.utils.compound_dataset_list` (:gh:`455` by `Pierre Guetschel`_)

Bugs
~~~~
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced_examples/plot_filterbank_csp_vs_csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from sklearn.pipeline import make_pipeline

import moabb
from moabb.datasets import BNCI2014001
from moabb.datasets import BNCI2014_001
from moabb.evaluations import CrossSessionEvaluation
from moabb.paradigms import FilterBankLeftRightImagery, LeftRightImagery
from moabb.pipelines.utils import FilterBank
Expand Down Expand Up @@ -61,7 +61,7 @@
# from 8 to 35 Hz.

# Because this is being auto-generated we only use 2 subjects
dataset = BNCI2014001()
dataset = BNCI2014_001()
dataset.subject_list = dataset.subject_list[:2]
datasets = [dataset]
overwrite = False # set to True if we want to overwrite cached results
Expand Down
8 changes: 4 additions & 4 deletions examples/advanced_examples/plot_grid_search_withinsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline

from moabb.datasets import BNCI2014001
from moabb.datasets import BNCI2014_001
from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import MotorImagery

Expand All @@ -30,7 +30,7 @@
# Select the Subject
subjects = [1]
# Load the dataset
dataset = BNCI2014001()
dataset = BNCI2014_001()

events = ["right_hand", "left_hand"]

Expand Down Expand Up @@ -144,7 +144,7 @@
os.path.join(
path,
"GridSearch_WithinSession",
"001-2014",
"BNCI2014-001",
"1",
"session_E",
"GridSearchEN",
Expand All @@ -164,7 +164,7 @@
os.path.join(
path,
"GridSearch_WithinSession",
"001-2014",
"BNCI2014-001",
"1",
"session_T",
"GridSearchEN",
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced_examples/plot_mne_and_scikit_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
find_significant_differences,
)
from moabb.analysis.plotting import paired_plot, summary_plot
from moabb.datasets import BNCI2014009
from moabb.datasets import BNCI2014_009
from moabb.evaluations import CrossSessionEvaluation
from moabb.paradigms import P300

Expand All @@ -52,7 +52,7 @@
#
# Load 2 subjects of BNCI 2014-009 dataset, with 3 session each

dataset = BNCI2014009()
dataset = BNCI2014_009()
dataset.subject_list = dataset.subject_list[:3]
datasets = [dataset]
paradigm = P300()
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced_examples/plot_select_electrodes_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from sklearn.pipeline import make_pipeline

import moabb.analysis.plotting as moabb_plt
from moabb.datasets import BNCI2014001, Zhou2016
from moabb.datasets import BNCI2014_001, Zhou2016
from moabb.datasets.utils import find_intersecting_channels
from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import LeftRightImagery
Expand All @@ -33,7 +33,7 @@
# Load 2 subjects of BNCI 2014-004 and Zhou2016 datasets, with 2 sessions each

subj = [1, 2]
datasets = [Zhou2016(), BNCI2014001()]
datasets = [Zhou2016(), BNCI2014_001()]
for d in datasets:
d.subject_list = subj

Expand Down
6 changes: 3 additions & 3 deletions examples/advanced_examples/plot_statistical_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
compute_dataset_statistics,
find_significant_differences,
)
from moabb.datasets import BNCI2014001
from moabb.datasets import BNCI2014_001
from moabb.evaluations import CrossSessionEvaluation
from moabb.paradigms import LeftRightImagery

Expand Down Expand Up @@ -70,7 +70,7 @@
# Evaluation
# ----------
#
# We define the paradigm (LeftRightImagery) and the dataset (BNCI2014001).
# We define the paradigm (LeftRightImagery) and the dataset (BNCI2014_001).
# The evaluation will return a DataFrame containing a single AUC score for
# each subject / session of the dataset, and for each pipeline.
#
Expand All @@ -79,7 +79,7 @@
# be overwritten if necessary.

paradigm = LeftRightImagery()
dataset = BNCI2014001()
dataset = BNCI2014_001()
dataset.subject_list = dataset.subject_list[:4]
datasets = [dataset]
overwrite = True # set to False if we want to use cached results
Expand Down
4 changes: 2 additions & 2 deletions examples/example_codecarbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
###############################################################################
from moabb import benchmark, set_log_level
from moabb.analysis.plotting import codecarbon_plot
from moabb.datasets import BNCI2014001, Zhou2016
from moabb.datasets import BNCI2014_001, Zhou2016
from moabb.paradigms import LeftRightImagery


Expand Down Expand Up @@ -69,7 +69,7 @@
# folder.

dataset = Zhou2016()
dataset2 = BNCI2014001()
dataset2 = BNCI2014_001()
dataset.subject_list = dataset.subject_list[:1]
dataset2.subject_list = dataset2.subject_list[:1]
datasets = [dataset, dataset2]
Expand Down
4 changes: 2 additions & 2 deletions examples/external/plot_learning_curve_p300_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from tdlda import Vectorizer as JumpingMeansVectorizer

import moabb
from moabb.datasets import BNCI2014009
from moabb.datasets import BNCI2014_009
from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import P300

Expand Down Expand Up @@ -99,7 +99,7 @@
# and dataset size.

paradigm = P300(resample=processing_sampling_rate)
dataset = BNCI2014009()
dataset = BNCI2014_009()
# Remove the slicing of the subject list to evaluate multiple subjects
dataset.subject_list = dataset.subject_list[0:1]
datasets = [dataset]
Expand Down
6 changes: 3 additions & 3 deletions examples/learning_curve/plot_learning_curve_motor_imagery.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from sklearn.pipeline import make_pipeline

import moabb
from moabb.datasets import BNCI2014001
from moabb.datasets import BNCI2014_001
from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import LeftRightImagery

Expand Down Expand Up @@ -63,7 +63,7 @@
# Evaluation
# ----------
#
# We define the paradigm (LeftRightImagery) and the dataset (BNCI2014001).
# We define the paradigm (LeftRightImagery) and the dataset (BNCI2014_001).
# The evaluation will return a DataFrame containing a single AUC score for
# each subject / session of the dataset, and for each pipeline.
#
Expand All @@ -72,7 +72,7 @@
# be overwritten if necessary.

paradigm = LeftRightImagery()
dataset = BNCI2014001()
dataset = BNCI2014_001()
dataset.subject_list = dataset.subject_list[:1]
datasets = [dataset]
overwrite = True # set to True if we want to overwrite cached results
Expand Down
4 changes: 2 additions & 2 deletions examples/learning_curve/plot_learning_curve_p300.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from sklearn.pipeline import make_pipeline

import moabb
from moabb.datasets import BNCI2014009
from moabb.datasets import BNCI2014_009
from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import P300

Expand Down Expand Up @@ -77,7 +77,7 @@
# and dataset size.

paradigm = P300(resample=processing_sampling_rate)
dataset = BNCI2014009()
dataset = BNCI2014_009()
# Remove the slicing of the subject list to evaluate multiple subjects
dataset.subject_list = dataset.subject_list[1:2]
datasets = [dataset]
Expand Down
Loading

0 comments on commit d2e973d

Please sign in to comment.