def test_change_zoom_level_larger_content(self): cy.fill_array(self.dim, self.arr) dim, buf, change, self.buf_stat = change_zoom_level( self.position, self.buf_len, self.buf_stat, self.change_roll, self.dim, self.buf) nu_arr = buf[self.position[0]] cy.fill_bounds(dim, nu_arr) testing.assert_array_equal(np.mean(nu_arr), np.mean(self.arr))
def test_fill_bounds(self): arr = tst_arr() cy.fill_bounds(tst_dim(), arr) arr2 = tst_arr() arr2[0, :] = 1 arr2[-1, :] = 1 arr2[:, 0] = 1 arr2[:, -1] = 1 testing.assert_array_equal(arr2, arr)
def test_basic_update_bounds(self): arr = np.copy(self.arr) basic_update( 0, self.beta, 0, prepair_rule(np.array([[-1, 0, 0, 0]], np.intc), self.head_pos), self.dim, self.arr, self.bounds, ) cy.fill_bounds(self.dim, arr) testing.assert_array_equal(arr, self.arr)
def test_basic_update_scroll(self): arr = np.copy(self.arr) basic_update( 0, self.beta, 0, prepair_rule(np.array([[-1, 0, 0, 0]], np.intc), self.head_pos), self.dim, self.arr, self.bounds, bars=np.array([[1, 1, 1, 0, 0, 1]], np.double), ) cy.fill_bounds(self.dim, arr) arr[1, :] = 1 testing.assert_array_equal(arr, self.arr)
def test_basic_update_buffer_bounds(self): arr = np.copy(self.arr) basic_update_buffer( 0, self.beta, 0, np.array([[-1, 0, 0, 0]], np.intc), self.head_pos, 10, self.dim, self.arr, self.buf, self.bounds, ) cy.fill_bounds(self.dim, arr) testing.assert_array_equal(arr, self.arr)
def test_change_zoom_level_array_larger_content(self): cy.fill_array(self.dim, self.arr) dim, arr, change = change_zoom_level_array(self.dim, self.arr) cy.fill_bounds(dim, arr) testing.assert_array_equal(np.mean(arr), np.mean(self.arr))