示例#1
0
 def test_kwargs(self):
     """Unexpected keywords"""
     with pytest.raises(KeyError):
         eeglcf._classify(1, 10, np.zeros([10] * 3), error=0)
     with pytest.raises(KeyError):
         eeglcf._classify(1, 10, feats=(np.zeros([10] * 3), ), error=0)
     with pytest.raises(KeyError):
         eeglcf._classify(1, 10)
示例#2
0
def ctrl(ifeats):
    """Control signal"""
    return eeglcf._classify(1., 10, *ifeats)
示例#3
0
 def test_features(self):
     """features must be arrays"""
     # Specified as non-keyworded arguments
     with pytest.raises(KeyError):
         eeglcf._classify(1, 10)
     with pytest.raises(TypeError):
         eeglcf._classify(1, 10, [0, 1, 2])
     with pytest.raises(TypeError):
         eeglcf._classify(1, 10, 'error')
     with pytest.raises(ValueError):
         eeglcf._classify(1, 10, np.zeros([2] * 4))
     with pytest.raises(ValueError):
         eeglcf._classify(1, 10, np.zeros([2] * 2))
     # Specified as keyworded a argument
     with pytest.raises(TypeError):
         eeglcf._classify(1, 10, feats=np.zeros([10] * 3))
     # Multiple definition of features
     with pytest.raises(KeyError):
         eeglcf._classify(1,
                          10,
                          np.zeros([10] * 3),
                          feats=[
                              np.zeros([10] * 3),
                          ])
示例#4
0
 def test_main(self, ifeats):
     """Functional test"""
     res = eeglcf._classify(1., 10, *ifeats)
     # Results must have the same shape as comps
     assert (res.shape == ifeats[0].shape)