Beispiel #1
0
def test_message():
    """Test converting value and coords to message."""
    shapes = [(40, 20), (20, 10), (10, 5)]
    np.random.seed(0)
    data = [np.random.random(s) for s in shapes]
    layer = Pyramid(data)
    coord, value = layer.get_value()
    msg = layer.get_message(coord, value)
    assert type(msg) == str
Beispiel #2
0
def test_value():
    """Test getting the value of the data at the current coordinates."""
    shapes = [(40, 20), (20, 10), (10, 5)]
    np.random.seed(0)
    data = [np.random.random(s) for s in shapes]
    layer = Pyramid(data)
    coord, value = layer.get_value()
    assert np.all(coord == [0, 0])
    assert value == data[-1][0, 0]