diff --git a/moabb/datasets/braininvaders.py b/moabb/datasets/braininvaders.py index 5eda4bd2e..7b79f962f 100644 --- a/moabb/datasets/braininvaders.py +++ b/moabb/datasets/braininvaders.py @@ -284,7 +284,7 @@ def _bi_data_path( # noqa: C901 zip_ref = z.ZipFile(path_zip, "r") zip_ref.extractall(path_folder) os.makedirs(osp.join(directory, f"Session{i + 1}")) - shutil.copy_tree(path_zip.strip(".zip"), directory) + shutil.copytree(path_zip.strip(".zip"), directory) shutil.rmtree(path_zip.strip(".zip")) # filter the data regarding the experimental conditions diff --git a/moabb/tests/test_benchmark.py b/moabb/tests/test_benchmark.py index 5425c1b3a..b307b38b4 100644 --- a/moabb/tests/test_benchmark.py +++ b/moabb/tests/test_benchmark.py @@ -23,28 +23,30 @@ def test_benchmark_strdataset(self): pipelines=str(self.pp_dir), evaluations=["WithinSession"], include_datasets=[ - "FakeDataset-imagery-10-2--60-60--120-120--lefthand-righthand--c3-cz-c4", - "FakeDataset-p300-10-2--60-60--120-120--target-nontarget--c3-cz-c4", - "FakeDataset-ssvep-10-2--60-60--120-120--13-15--c3-cz-c4", - "FakeDataset-cvep-10-2--60-60--120-120--10-00--c3-cz-c4", + "FakeDataset-imagery-2-2--60-60--120-120--lefthand-righthand--c3-cz-c4", + "FakeDataset-p300-2-2--60-60--120-120--target-nontarget--c3-cz-c4", + "FakeDataset-ssvep-2-2--60-60--120-120--13-15--c3-cz-c4", + "FakeDataset-cvep-2-2--60-60--120-120--10-00--c3-cz-c4", ], overwrite=True, ) - assert len(res) == 80 + assert len(res) == 24 def test_benchmark_objdataset(self): res = benchmark( pipelines=str(self.pp_dir), evaluations=["WithinSession"], include_datasets=[ - FakeDataset(["left_hand", "right_hand"], paradigm="imagery"), - FakeDataset(["Target", "NonTarget"], paradigm="p300"), - FakeDataset(["13", "15"], paradigm="ssvep"), - FakeDataset(["1.0", "0.0"], paradigm="cvep"), + FakeDataset( + ["left_hand", "right_hand"], paradigm="imagery", n_subjects=2 + ), + FakeDataset(["Target", "NonTarget"], paradigm="p300", n_subjects=2), + FakeDataset(["13", "15"], paradigm="ssvep", n_subjects=2), + FakeDataset(["1.0", "0.0"], paradigm="cvep", n_subjects=2), ], overwrite=True, ) - assert len(res) == 80 + assert len(res) == 24 def test_nodataset(self): with pytest.raises(ValueError): @@ -61,7 +63,7 @@ def test_selectparadigm(self): paradigms=["FakeImageryParadigm"], overwrite=True, ) - assert len(res) == 40 + assert len(res) == 16 def test_include_exclude(self): with pytest.raises(AttributeError): diff --git a/moabb/tests/test_pipelines/SSVEP_CCA.yml b/moabb/tests/test_pipelines/CCA-SSVEP.yml similarity index 100% rename from moabb/tests/test_pipelines/SSVEP_CCA.yml rename to moabb/tests/test_pipelines/CCA-SSVEP.yml diff --git a/moabb/tests/test_pipelines/CSP_SVM_grid.yml b/moabb/tests/test_pipelines/CSP_SVM_grid.yml new file mode 100644 index 000000000..2486b53f8 --- /dev/null +++ b/moabb/tests/test_pipelines/CSP_SVM_grid.yml @@ -0,0 +1,31 @@ +name: CSP + SVM Grid + +paradigms: + - FakeImageryParadigm + +pipeline: + - name: Covariances + from: pyriemann.estimation + parameters: + estimator: oas + + - name: CSP + from: pyriemann.spatialfilters + parameters: + nfilter: 6 + + - name: SVC + from: sklearn.svm + parameters: + kernel: "linear" + +param_grid: + csp__nfilter: + - 2 + - 4 + - 6 + svc__C: + - 1 + svc__kernel: + - "rbf" + - "linear" diff --git a/moabb/tests/test_pipelines/WTRCSP.py b/moabb/tests/test_pipelines/WTRCSP.py new file mode 100644 index 000000000..05afc42c0 --- /dev/null +++ b/moabb/tests/test_pipelines/WTRCSP.py @@ -0,0 +1,11 @@ +from pyriemann.estimation import Covariances +from sklearn.discriminant_analysis import LinearDiscriminantAnalysis +from sklearn.pipeline import make_pipeline + +from moabb.pipelines.csp import TRCSP + + +pipe = make_pipeline(Covariances("scm"), TRCSP(nfilter=6), LinearDiscriminantAnalysis()) + +# this is what will be loaded +PIPELINE = {"name": "TRCSP + LDA", "paradigms": ["FakeImageryParadigm"], "pipeline": pipe} diff --git a/moabb/tests/test_pipelines/XdawnCov_MDM.yml b/moabb/tests/test_pipelines/XdawnCov_MDM.yml new file mode 100644 index 000000000..12527feda --- /dev/null +++ b/moabb/tests/test_pipelines/XdawnCov_MDM.yml @@ -0,0 +1,14 @@ +name: XdawnCovariances + MDM + +paradigms: + - FakeP300Paradigm + +pipeline: + - name: XdawnCovariances + from: pyriemann.estimation + parameters: + estimator: oas + xdawn_estimator: scm + + - name: MDM + from: pyriemann.classification