Esempio n. 1
0
def test_values_mask_setter(input_val, expected_data, expected_mask):
    surf = RegularSurface(
        2,
        2,
        0.0,
        0.0,
        values=np.ma.MaskedArray([[2, 2], [2, 2]],
                                 mask=[[True, False], [False, True]]),
    )
    surf.values = input_val
    assert surf.values.mask.tolist() == expected_mask
    assert list(surf.values.data.flatten()) == expected_data
Esempio n. 2
0
def test_values_setter(input_values, input_val, expected_result):
    surf = RegularSurface(2, 2, 0.0, 0.0, values=input_values)
    surf.values = input_val
    assert surf.values.data.tolist() == expected_result