def test_nd_sqeezable(self): a = np.random.randn(1, 1, 1, 1, 100, 1, 1, 1, 1) b = utils.np_squeeze_check(a) self._check_data(a, b)
def test_nd(self): a = np.random.randn(3, 4, 5, 6, 7, 9) with pytest.raises(ValueError) as ex_info: utils.np_squeeze_check(a)
def test_row(self): a = np.c_[1:10].T b = utils.np_squeeze_check(a) self._check_data(a, b)
def test_2d(self): a = np.c_[1:10, 2:11] with pytest.raises(ValueError) as ex_info: utils.np_squeeze_check(a)
def test_1d(self): a = np.array([1, 2, 3]) b = utils.np_squeeze_check(a) self._check_data(a, b)