Beispiel #1
0
def test_hollowsphere_degenerate_neighborhood():
    """Test either we sustain empty neighborhoods
    """
    hs = ne.HollowSphere(1, inner_radius=0, element_sizes=(3, 3, 3))
    assert_equal(len(hs((1, 1, 1))), 0)
Beispiel #2
0
def test_hollowsphere_include_center():
    hs = ne.HollowSphere(1, 0, include_center=True)
    assert_array_equal(hs((2, 1)), [(2, 1), (1, 1), (2, 0), (2, 2), (3, 1)])
    assert_array_equal(hs((1, )), [(1, ), (0, ), (2, )])
    assert_equal(len(hs((1, 1, 1))), 7)
Beispiel #3
0
def test_hollowsphere_basic():
    hs = ne.HollowSphere(1, 0)
    assert_array_equal(hs((2, 1)), [(1, 1), (2, 0), (2, 2), (3, 1)])
    assert_array_equal(hs((1, )), [(0, ), (2, )])
    assert_equal(len(hs((1, 1, 1))), 6)