def test_remove_channels(self): """Removing channels with an array of regexes.""" channels = self.dat.data.copy() self.dat = remove_channels(self.dat, ['ca.*', 'cc1']) np.testing.assert_array_equal(self.dat.axes[-1], np.array(['cb1', 'cb2'])) np.testing.assert_array_equal(self.dat.data, channels[:, np.array([2, 3])])
def test_remove_channels_swapaxis(self): """Remove channels works with non default chanaxis.""" dat1 = remove_channels(swapaxes(self.dat, 0, 1), ['ca.*'], chanaxis=0) dat1 = swapaxes(dat1, 0, 1) dat2 = remove_channels(self.dat, ['ca.*']) self.assertEqual(dat1, dat2)