Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a8c1918
n classes not 2
Aug 1, 2023
b0a5530
Merge branch 'NeuroTechX:develop' into filter_bank_classes
Sara04 Aug 9, 2023
1a4b71b
Remove repeating
Aug 9, 2023
b489b90
Merge branch 'filter_bank_classes' of https://github.com/Sara04/moabb…
Aug 9, 2023
ec41d89
Update what's new
Aug 10, 2023
6fd8c6d
wrong whats new
Aug 10, 2023
9639253
Merge branch 'NeuroTechX:develop' into filter_bank_classes
Sara04 Aug 10, 2023
cecb1fc
Merge branch 'NeuroTechX:develop' into filter_bank_classes
Sara04 Aug 18, 2023
da955e8
Remove Band Pass class
Sara04 Aug 18, 2023
a60bbb3
Merge branch 'filter_bank_classes' of https://github.com/Sara04/moabb…
Sara04 Aug 18, 2023
022a891
Update is valid method
Sara04 Aug 21, 2023
cb07f43
Merge branch 'NeuroTechX:develop' into filter_bank_classes
Sara04 Aug 21, 2023
0d226c8
Add docstring inheritance
Sara04 Aug 21, 2023
aaaabec
Merge branch 'filter_bank_classes' of https://github.com/Sara04/moabb…
Sara04 Aug 21, 2023
698eb79
Merge branch 'NeuroTechX:develop' into filter_bank_classes
Sara04 Aug 21, 2023
302fcf6
Merge branch 'NeuroTechX:develop' into filter_bank_classes
Sara04 Aug 21, 2023
3391ea4
update filterbank MI
Sara04 Aug 21, 2023
314490a
Merge branch 'filter_bank_classes' of https://github.com/Sara04/moabb…
Sara04 Aug 21, 2023
5f2c768
First check, after super init
Sara04 Aug 21, 2023
c38fad4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 21, 2023
54291e1
Add n classes argument
Sara04 Aug 22, 2023
52eace1
Merge branch 'filter_bank_classes' of https://github.com/Sara04/moabb…
Sara04 Aug 22, 2023
5f77f33
Merge branch 'develop' into filter_bank_classes
PierreGtch Oct 18, 2023
54487a7
Update moabb/utils.py
Sara04 Oct 19, 2023
ca6479b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 19, 2023
2c45a05
Update moabb/utils.py
Sara04 Oct 19, 2023
36178c5
Update numpy docstring class and change Attributes to Parameters
Sara04 Oct 19, 2023
665d3d2
Merge branch 'NeuroTechX:develop' into filter_bank_classes
Sara04 Oct 19, 2023
8ac9dd2
Merge branch 'develop' into filter_bank_classes
PierreGtch Apr 12, 2024
55c5db6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 12, 2024
9aae7ac
Merge branch 'develop' into filter_bank_classes
PierreGtch May 30, 2024
4ee80f1
Merge branch 'develop' into filter_bank_classes
bruAristimunha Jul 3, 2024
be4545d
Remove SinglePass and FilterBank intermediate classes
bruAristimunha Feb 7, 2026
d821f03
Merge remote-tracking branch 'origin/develop' into filter_bank_classes
bruAristimunha Feb 7, 2026
aa67eec
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 7, 2026
8ec3f89
Address review feedback from automated reviewers
bruAristimunha Feb 7, 2026
99d7a7a
Remove SinglePass intermediate class from P300 paradigms
bruAristimunha Feb 7, 2026
0cfa036
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 7, 2026
331a6e8
Refine paradigm constructor docs and argument guards
bruAristimunha Feb 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ P300 Paradigms
:toctree: generated/
:template: class.rst

SinglePass
P300
P300

---------------
SSVEP Paradigms
Expand Down Expand Up @@ -270,8 +269,6 @@ Base & Utils
:template: class.rst

motor_imagery.BaseMotorImagery
motor_imagery.SinglePass
motor_imagery.FilterBank
p300.BaseP300
ssvep.BaseSSVEP
BaseFixedIntervalWindowsProcessing
Expand Down
1 change: 1 addition & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Enhancements

API changes
~~~~~~~~~~~
- Removed ``SinglePass`` and ``FilterBank`` intermediate classes from motor imagery and P300 paradigms. ``FilterBankLeftRightImagery`` now inherits from ``LeftRightImagery``, ``FilterBankMotorImagery`` inherits from ``MotorImagery``, and ``P300`` inherits directly from ``BaseP300``. ``RestingStateToP300Adapter`` now inherits from ``BaseP300``. Docstring inheritance is handled via ``NumpyDocstringInheritanceInitMeta`` (:gh:`467` by `Bruno Aristimunha`_).
- Allow CodeCarbon script level configurations when instantiating a :class:`moabb.evaluations.base.BaseEvaluation` child class (:gh:`866` by `Ethan Davis`_).
- When CodeCarbon is installed, MOABB HDF5 results have an additional column `codecarbon_task_name`. If CodeCarbon is configured to save to file, its own tabular results have a column `task_name`. These columns are unique UUID4s. Related rows can be joined to see detailed costs and benefits of predictive performance and computing profiling metrics (:gh:`866` by `Ethan Davis`_).
- Isolated model fitting, duration tracking, and CodeCarbon compute profiling tracking. New and consistent ordering of duration and CodeCarbon tracking across all evaluations: (Higher priority, closest to model fitting) required duration tracking, (lower priority, second closest to model fitting) optional CodeCarbon tracking (:gh:`866` by `Ethan Davis`_).
Expand Down
5 changes: 3 additions & 2 deletions moabb/paradigms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
get_resample_pipeline,
make_fixed_pipeline,
)
from moabb.utils import MoabbMetaClass


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -188,7 +189,7 @@ def _is_valid_scorer_item(item):
return scorer


class BaseProcessing(metaclass=abc.ABCMeta):
class BaseProcessing(metaclass=MoabbMetaClass):
"""Base Processing.

Please use one of the child classes
Expand Down Expand Up @@ -744,7 +745,7 @@ class BaseParadigm(BaseProcessing):
----------

events: List of str | None (default None)
event to use for epoching. If None, default to all events defined in
events to use for epoching. If None, default to all events defined in
the dataset.

scorer: sklearn-compatible string or a compatible sklearn scorer | None (default None)
Expand Down
154 changes: 50 additions & 104 deletions moabb/paradigms/cvep.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,6 @@ class BaseCVEP(BaseParadigm):
n_classes: int or None (default None)
Number of classes each dataset must have. All dataset classes if None.

tmin: float (default 0.0)
Start time (in second) of the epoch, relative to the dataset specific
task interval e.g. tmin = 1 would mean the epoch will start 1 second
after the beginning of the task as defined by the dataset.

tmax: float | None (default None)
End time (in second) of the epoch, relative to the beginning of the
dataset specific task interval. tmax = 5 would mean the epoch will end
5 second after the beginning of the task as defined in the dataset. If
None, use the dataset value.

baseline: None | tuple of length 2 (default None)
The time interval to consider as “baseline” when applying baseline
correction. If None, do not apply baseline correction.
If a tuple (a, b), the interval is between a and b (in seconds),
including the endpoints.
Correction is applied by computing the mean of the baseline period
and subtracting it from the data (see mne.Epochs)

channels: list of str | None (default None)
list of channel to select. If None, use all EEG channels available in
the dataset.

resample: float | None (default None)
If not None, resample the eeg data with the sampling rate provided.

scorer: sklearn-compatible string or a compatible sklearn scorer | None (default None)
If None, and n_classes==2 use the roc_auc, else use accuracy.

Notes
-----

Expand Down Expand Up @@ -176,7 +147,6 @@ class CVEP(BaseCVEP):
the target code. The code value is between 0 (i.e., stimulation off)
and 1 (i.e., maximal stimulation).


Parameters
----------
fmin: float (default 1.0)
Expand All @@ -185,55 +155,40 @@ class CVEP(BaseCVEP):
fmax: float (default 45.0)
cutoff frequency (Hz) for the lowpass filter

events: List of str | None (default None)
Event to use for epoching. Note, we stick to a convention where the
intensity level is encoded as float. For example, a binary sequence
would have events 1.0 (i.e., on) and 0.0 (i.e., off). If None, default
to all events defined in the dataset.

n_classes: int or None (default None)
Number of classes each dataset must have. All dataset classes if None

tmin: float (default 0.0)
Start time (in second) of the epoch, relative to the dataset specific
task interval e.g. tmin = 1 would mean the epoch will start 1 second
after the beginning of the task as defined by the dataset.

tmax: float | None, (default None)
End time (in second) of the epoch, relative to the beginning of the
dataset specific task interval. tmax = 5 would mean the epoch will end
5 second after the beginning of the task as defined in the dataset. If
None, use the dataset value.

baseline: None | tuple of length 2 (default None)
The time interval to consider as “baseline” when applying baseline
correction. If None, do not apply baseline correction.
If a tuple (a, b), the interval is between a and b (in seconds),
including the endpoints.
Correction is applied by computing the mean of the baseline period
and subtracting it from the data (see mne.Epochs)

channels: list of str | None (default None)
List of channel to select. If None, use all EEG channels available in
the dataset.

resample: float | None (default None)
If not None, resample the eeg data with the sampling rate provided.

scorer: sklearn-compatible string or a compatible sklearn scorer | None (default None)
If None, and n_classes==2 use the roc_auc, else use accuracy.

Notes
-----

.. versionadded:: 1.0.0

"""

def __init__(self, fmin=1.0, fmax=45.0, **kwargs):
if "filters" in kwargs.keys():
raise (ValueError("c-VEP does not take argument filters"))
super().__init__(filters=((fmin, fmax),), **kwargs)
def __init__(
self,
fmin=1.0,
fmax=45.0,
filters=None,
events=None,
n_classes=None,
tmin=0.0,
tmax=None,
baseline=None,
channels=None,
resample=None,
scorer=None,
):
if filters is not None:
raise ValueError("c-VEP does not take argument filters")
super().__init__(
filters=((fmin, fmax),),
events=events,
n_classes=n_classes,
tmin=tmin,
tmax=tmax,
baseline=baseline,
channels=channels,
resample=resample,
scorer=scorer,
)


class FilterBankCVEP(BaseCVEP):
Expand All @@ -251,36 +206,6 @@ class FilterBankCVEP(BaseCVEP):
----------
filters: tuple of tuple | None (default ((1., 45.), (12., 45.), (30., 45.)))
Bank of bandpass filter to apply.
events: List of str | None (default None)
Event to use for epoching. Note, we stick to a convention where the
intensity level is encoded as float. For example, a binary sequence
would have events 1.0 (i.e., on) and 0.0 (i.e., off). If None, default
to all events defined in the dataset.
n_classes: int or None (default None)
Number of classes each dataset must have. All dataset classes if None
tmin: float (default 0.0)
Start time (in second) of the epoch, relative to the dataset specific
task interval e.g. tmin = 1 would mean the epoch will start 1 second
after the beginning of the task as defined by the dataset.
tmax: float | None, (default None)
End time (in second) of the epoch, relative to the beginning of the
dataset specific task interval. tmax = 5 would mean the epoch will end
5 second after the beginning of the task as defined in the dataset. If
None, use the dataset value.
baseline: None | tuple of length 2 (default None)
The time interval to consider as “baseline” when applying baseline
correction. If None, do not apply baseline correction.
If a tuple (a, b), the interval is between a and b (in seconds),
including the endpoints.
Correction is applied by computing the mean of the baseline period
and subtracting it from the data (see mne.Epochs)
channels: list of str | None (default None)
List of channel to select. If None, use all EEG channels available in
the dataset.
resample: float | None (default None)
If not None, resample the eeg data with the sampling rate provided.
scorer: sklearn-compatible string or a compatible sklearn scorer | None (default None)
If None, and n_classes==2 use the roc_auc, else use accuracy.

Notes
-----
Expand All @@ -289,8 +214,29 @@ class FilterBankCVEP(BaseCVEP):

"""

def __init__(self, filters=((1.0, 45.0), (12.0, 45.0), (30.0, 45.0)), **kwargs):
super().__init__(filters=filters, **kwargs)
def __init__(
self,
filters=((1.0, 45.0), (12.0, 45.0), (30.0, 45.0)),
events=None,
n_classes=None,
tmin=0.0,
tmax=None,
baseline=None,
channels=None,
resample=None,
scorer=None,
):
super().__init__(
filters=filters,
events=events,
n_classes=n_classes,
tmin=tmin,
tmax=tmax,
baseline=baseline,
channels=channels,
resample=resample,
scorer=scorer,
)


class FakeCVEPParadigm(BaseCVEP):
Expand Down
85 changes: 2 additions & 83 deletions moabb/paradigms/fixed_interval_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,6 @@ class BaseFixedIntervalWindowsProcessing(BaseProcessing):
Parameters
----------

filters: list of list (default [[7, 45]])
bank of bandpass filter to apply.

baseline: None | tuple of length 2
The time interval to consider as “baseline” when applying baseline
correction. If None, do not apply baseline correction.
If a tuple (a, b), the interval is between a and b (in seconds),
including the endpoints.
Correction is applied by computing the mean of the baseline period
and subtracting it from the data (see mne.Epochs)

channels: list of str | None (default None)
list of channel to select. If None, use all EEG channels available in
the dataset.

resample: float | None (default None)
If not None, resample the eeg data with the sampling rate provided.

length: float (default 5.0)
Length of the epochs in seconds.

Expand Down Expand Up @@ -133,45 +115,13 @@ class FixedIntervalWindowsProcessing(BaseFixedIntervalWindowsProcessing):
Paradigm for creating epochs at fixed interval,
ignoring the stim channel and events of the dataset.

Parameters
----------

Parameters
----------
fmin: float (default 7)
cutoff frequency (Hz) for the high pass filter

fmax: float (default 45)
cutoff frequency (Hz) for the low pass filter

baseline: None | tuple of length 2
The time interval to consider as “baseline” when applying baseline
correction. If None, do not apply baseline correction.
If a tuple (a, b), the interval is between a and b (in seconds),
including the endpoints.
Correction is applied by computing the mean of the baseline period
and subtracting it from the data (see mne.Epochs)

channels: list of str | None (default None)
list of channel to select. If None, use all EEG channels available in
the dataset.

resample: float | None (default None)
If not None, resample the eeg data with the sampling rate provided.

length: float (default 5.0)
Length of the epochs in seconds.

stride: float (default 10.0)
Stride between epochs in seconds.

start_offset: float (default 0.0)
Start from the beginning of the raw recordings in seconds.

stop_offset: float | None (default None)
Stop offset from beginning of raw recordings in seconds.
If None, set to be the end of the recording.

marker: int (default -1)
Marker to use for the events created.
"""

def __init__(
Expand Down Expand Up @@ -212,37 +162,6 @@ class FilterBankFixedIntervalWindowsProcessing(BaseFixedIntervalWindowsProcessin

filters: list of list (default ((8, 12), (12, 16), (16, 20), (20, 24), (24, 28), (28, 32)))
bank of bandpass filter to apply.

baseline: None | tuple of length 2
The time interval to consider as “baseline” when applying baseline
correction. If None, do not apply baseline correction.
If a tuple (a, b), the interval is between a and b (in seconds),
including the endpoints.
Correction is applied by computing the mean of the baseline period
and subtracting it from the data (see mne.Epochs)

channels: list of str | None (default None)
list of channel to select. If None, use all EEG channels available in
the dataset.

resample: float | None (default None)
If not None, resample the eeg data with the sampling rate provided.

length: float (default 5.0)
Length of the epochs in seconds.

stride: float (default 10.0)
Stride between epochs in seconds.

start_offset: float (default 0.0)
Start from the beginning of the raw recordings in seconds.

stop_offset: float | None (default None)
Stop offset from beginning of raw recordings in seconds.
If None, set to be the end of the recording.

marker: int (default -1)
Marker to use for the events created.
"""

def __init__(
Expand Down
Loading
Loading