def test_with_status_at_node():
    status = sgrid.status_at_node((4, 5))
    status[6] = sgrid.CLOSED_BOUNDARY
    active_links = sgrid.active_links((4, 5), node_status_array=status)

    assert_array_equal(
        active_links,
        np.array([2, 3, 7, 8, 11, 12, 13, 21, 22, 23, 24, 25, 26]))
def test_node_status_4_by_5():
    status = sgrid.status_at_node((4, 5))
    assert status.dtype == np.int8
    assert_array_equal(
        status,
        np.array([[1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, 0, 0, 0, 1],
                  [1, 1, 1, 1, 1]]).flatten(),
    )
Example #3
0
def test_with_status_at_node():
    status = sgrid.status_at_node((4, 5))
    status[6] = sgrid.CLOSED_BOUNDARY
    active_links = sgrid.active_links((4, 5), node_status_array=status)

    assert_array_equal(
        active_links, np.array([2, 3, 7, 8, 11, 12, 13, 21, 22, 23, 24, 25, 26])
    )
Example #4
0
def test_node_status_4_by_5():
    status = sgrid.status_at_node((4, 5))
    assert status.dtype == np.int8
    assert_array_equal(
        status,
        np.array(
            [[1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 1]]
        ).flatten(),
    )
def test_no_interiors():
    status = sgrid.status_at_node((2, 3))
    assert status.dtype == np.int8
    assert_array_equal(status, np.array([
        1,
        1,
        1,
        1,
        1,
        1,
    ]))
Example #6
0
def test_node_status_no_interiors():
    status = sgrid.status_at_node((2, 3))
    assert status.dtype == np.int8
    assert_array_equal(status, np.array([1, 1, 1, 1, 1, 1]))