Ejemplo n.º 1
0
def test_north_links():
    links = sgrid.north_links((3, 4))
    assert_array_equal(links, np.array([[0, 1, 2, 3], [4, 5, 6, 7], [-1, -1, -1, -1]]))

    links = sgrid.north_links((1, 4))
    assert_array_equal(links, np.array([[-1, -1, -1, -1]]))

    links = sgrid.north_links((4, 1))
    assert_array_equal(links, np.array([[0, 1, 2, -1]]).T)
Ejemplo n.º 2
0
def test_north_links():
    links = sgrid.north_links((3, 4))
    assert_array_equal(
        links, np.array([[3, 4, 5, 6], [10, 11, 12, 13], [-1, -1, -1, -1]]))

    links = sgrid.north_links((1, 4))
    assert_array_equal(links, np.array([[-1, -1, -1, -1]]))

    links = sgrid.north_links((4, 1))
    assert_array_equal(links, np.array([[0, 1, 2, -1]]).T)
Ejemplo n.º 3
0
    def test_north_links(self):
        links = sgrid.north_links((3, 4))
        self.assertArrayEqual(links, np.array([[ 0,  1,  2,  3],
                                            [ 4,  5,  6,  7],
                                            [-1, -1, -1, -1]]))

        links = sgrid.north_links((1, 4))
        self.assertArrayEqual(links, np.array([[-1, -1, -1, -1]]))

        links = sgrid.north_links((4, 1))
        self.assertArrayEqual(links, np.array([[0, 1, 2, -1]]).T)