def test_convolve_multiple_2d_y_constant(self): my_convolve_1 = convolve(self.x3, self.y3, constant_y=True) my_convolve_2 = convolve(self.x3, self.y3, 'same', constant_y=True) my_convolve_3 = convolve(self.x3, self.y3, 'valid', constant_y=True) assert_array_almost_equal(my_convolve_1(self.x3), self.cx3y3) assert_array_almost_equal(my_convolve_2(self.x3), self.cx3y3[1:6, 1:6]) assert_array_almost_equal(my_convolve_3(self.x3), self.cx3y3[2:5, 3:5])
def test_convolve_1d(self): my_convolve_1 = convolve(self.x, self.y) my_convolve_2 = convolve(self.x, self.y, 'same') my_convolve_3 = convolve(self.x, self.y, 'valid') assert_array_almost_equal(my_convolve_1(self.x, self.y), self.cxy) assert_array_almost_equal(my_convolve_2(self.x, self.y), self.cxy[2:9]) assert_array_almost_equal(my_convolve_3(self.x, self.y), self.cxy[4:7])
def test_convolve_multiple_2d(self): my_convolve_1 = convolve(self.x3, self.y3) my_convolve_2 = convolve(self.x3, self.y3, 'same') my_convolve_3 = convolve(self.x3, self.y3, 'valid') assert_array_almost_equal(my_convolve_1(self.x3, self.y3), self.cx3y3) assert_array_almost_equal(my_convolve_2(self.x3, self.y3), self.cx3y3[1:6, 1:6]) assert_array_almost_equal(my_convolve_3(self.x3, self.y3), self.cx3y3[2:5, 3:5])
def test_convolve_single_2d(self): my_convolve_1 = convolve(self.x2, self.y2, axis=-1) my_convolve_2 = convolve(self.x2, self.y2, 'same', axis=-1) my_convolve_3 = convolve(self.x2, self.y2, 'valid', axis=-1) assert_array_almost_equal(my_convolve_1(self.x2, self.y2), self.cx2y2) assert_array_almost_equal(my_convolve_2(self.x2, self.y2), self.cx2y2[:, 2:9]) assert_array_almost_equal(my_convolve_3(self.x2, self.y2), self.cx2y2[:, 4:7])
def test_convolve_single_2d(self): my_convolve_1 = convolve(self.x2, self.y2, axes=-1) my_convolve_2 = convolve(self.x2, self.y2, 'same', axes=-1) my_convolve_3 = convolve(self.x2, self.y2, 'valid', axes=-1) assert_array_almost_equal(my_convolve_1(self.x2, self.y2), self.cx2y2) assert_array_almost_equal(my_convolve_2(self.x2, self.y2), self.cx2y2[:, 2:9]) assert_array_almost_equal(my_convolve_3(self.x2, self.y2), self.cx2y2[:, 4:7])
def test_convolve_1d_y_constant(self): my_convolve_1 = convolve(self.x, self.y, constant_y=True) my_convolve_2 = convolve(self.x, self.y, 'same', constant_y=True) my_convolve_3 = convolve(self.x, self.y, 'valid', constant_y=True) assert_array_almost_equal(my_convolve_1(self.x), self.cxy) assert_array_almost_equal(my_convolve_2(self.x), self.cxy[2:9]) assert_array_almost_equal(my_convolve_3(self.x), self.cxy[4:7])
def test_convolve_single_2d_segments_1d(self): xs = np.array([self.x2, self.x2]) my_convolve_1 = convolve(xs, self.y, x_segmented=True) assert_array_almost_equal(my_convolve_1(0, self.y), self.cx2y)
def test_convolve_2d_segments_2d(self): xs = np.array([self.x3, self.x3]) my_convolve_1 = convolve(xs, self.y3, x_segmented=True) assert_array_almost_equal(my_convolve_1(0, self.y3), self.cx3y3)
def test_convolve_1d_segments_1d(self): my_convolve_1 = convolve(self.x2, self.y, x_segmented=True) assert_array_almost_equal(my_convolve_1(0, self.y), self.cx2y[0]) assert_array_almost_equal(my_convolve_1(1, self.y), self.cx2y[1])
def test_convolve_1d_single_2d(self): my_convolve_1 = convolve(self.x, self.y2) assert_array_almost_equal(my_convolve_1(self.x, self.y2), self.cxy2)
def test_convolve_single_2d_1d(self): my_convolve_1 = convolve(self.x2, self.y) assert_array_almost_equal(my_convolve_1(self.x2, self.y), self.cx2y)