(
        self,
        evaluation_class,
        paradigm_class,
        suffix="",
        overwrite=False,
        hdf5_path=None,
        additional_columns=None,
    )
class that will abstract result storage
class that will abstract result storage
class that will abstract result storage
def __init__(
        self,
        evaluation_class,
        paradigm_class,
        suffix="",
        overwrite=False,
        hdf5_path=None,
        additional_columns=None,
    ):
        """
        class that will abstract result storage
        """
        from moabb.evaluations.base import BaseEvaluation
        from moabb.paradigms.base import BaseParadigm

        assert issubclass(evaluation_class, BaseEvaluation)
        assert issubclass(paradigm_class, BaseParadigm)

        if additional_columns is None:
            self.additional_columns = []
        else:
            assert all([isinstance(ac, str) for ac in additional_columns])
            self.additional_columns = additional_columns

        if hdf5_path is None:
            if get_config("MOABB_RESULTS") is None:
                set_config("MOABB_RESULTS", osp.join(osp.expanduser("~"), "mne_data"))
            self.mod_dir = _get_path(None, "MOABB_RESULTS", "results")
            # was previously stored in the moabb source file folder:
            # self.mod_dir = osp.dirname(osp.abspath(inspect.getsourcefile(moabb)))
        else:
            self.mod_dir = osp.abspath(hdf5_path)
        self.filepath = osp.join(
            self.mod_dir,
            "results",
            paradigm_class.__name__,
            evaluation_class.__name__,
            "results{}.hdf5".format("_" + suffix),
        )

        os.makedirs(osp.dirname(self.filepath), exist_ok=True)
        self.filepath = self.filepath

        if overwrite and osp.isfile(self.filepath):
            os.remove(self.filepath)

        if not osp.isfile(self.filepath):
            with h5py.File(self.filepath, "w") as f:
                f.attrs["create_time"] = np.string_(
                    "{:%Y-%m-%d, %H:%M}".format(datetime.now())
                )
def __init__ ( self , evaluation_class , paradigm_class , suffix = "" , overwrite = False , hdf5_path = None , additional_columns = None , ) : from moabb . evaluations . base import BaseEvaluation from moabb . paradigms . base import BaseParadigm assert issubclass ( evaluation_class , BaseEvaluation ) assert issubclass ( paradigm_class , BaseParadigm ) if additional_columns is None : self . additional_columns = [ ] else : assert all ( [ isinstance ( ac , str ) for ac in additional_columns ] ) self . additional_columns = additional_columns if hdf5_path is None : if get_config ( "MOABB_RESULTS" ) is None : set_config ( "MOABB_RESULTS" , osp . join ( osp . expanduser ( "~" ) , "mne_data" ) ) self . mod_dir = _get_path ( None , "MOABB_RESULTS" , "results" ) # was previously stored in the moabb source file folder: # self.mod_dir = osp.dirname(osp.abspath(inspect.getsourcefile(moabb))) else : self . mod_dir = osp . abspath ( hdf5_path ) self . filepath = osp . join ( self . mod_dir , "results" , paradigm_class . __name__ , evaluation_class . __name__ , "results{}.hdf5" . format ( "_" + suffix ) , ) os . makedirs ( osp . dirname ( self . filepath ) , exist_ok = True ) self . filepath = self . filepath if overwrite and osp . isfile ( self . filepath ) : os . remove ( self . filepath ) if not osp . isfile ( self . filepath ) : with h5py . File ( self . filepath , "w" ) as f : f . attrs [ "create_time" ] = np . string_ ( "{:%Y-%m-%d, %H:%M}" . format ( datetime . now ( ) ) )