def test_get_connectivity_pairs(self): """Test function get_connectivity_pairs.""" d_3d = self._get_data(3) ds = DatasetEphy(d_3d, times='times', **kw) for direction in [True, False]: for blocks in [True, False]: df_1, df_2 = ds.get_connectivity_pairs(directed=direction, as_blocks=blocks, verbose=False) assert isinstance(df_1, pd.DataFrame) assert isinstance(df_2, pd.DataFrame)
def test_nb_min_suj(self): """Test if the selection based on a minimum number of subjects.""" d_3d = self._get_data(3) roi = [['r2', 'r1', 'r0', 'r3', 'r4'], ['r0', 'r1', 'r5', 'r6', 'r7']] # nb_min_suj = -inf ds = DatasetEphy(d_3d, roi=roi, nb_min_suj=None, **kw) assert len(ds.roi_names) == 8 ds.get_connectivity_pairs(directed=False, as_blocks=True)[0] df = ds.get_connectivity_pairs(directed=False)[0] assert len(df) == 19 ds.get_connectivity_pairs(directed=True, as_blocks=True)[0] df = ds.get_connectivity_pairs(directed=True)[0] assert len(df) == 38 # nb_min_suj = 2 ds = DatasetEphy(d_3d, roi=roi, nb_min_suj=2, **kw) assert len(ds.roi_names) == 2 ds.get_connectivity_pairs(directed=False, as_blocks=True)[0] df = ds.get_connectivity_pairs(directed=False)[0] assert len(df) == 1 ds.get_connectivity_pairs(directed=True, as_blocks=True)[0] df = ds.get_connectivity_pairs(directed=True)[0] assert len(df) == 2