def test_arithmetic_id_scalar():
    d = Data(x=[1, 2, 3, 4], y=[10, 20, 10, 20])
    assert_array_equal(d[d.id['x'] + 3], [4, 5, 6, 7])
    assert_array_equal(d[d.id['x'] - 3], [-2, -1, 0, 1])
    assert_array_equal(d[d.id['x'] * 3], [3, 6, 9, 12])
    assert_array_equal(d[d.id['y'] / 10], [1, 2, 1, 2])
    assert_array_equal(d[d.id['x'] ** 2], [1, 4, 9, 16])

    assert_array_equal(d[3 + d.id['x']], [4, 5, 6, 7])
    assert_array_equal(d[3 - d.id['x']], [2, 1, 0, -1])
    assert_array_equal(d[3 * d.id['x']], [3, 6, 9, 12])
    assert_array_equal(d[24 / d.id['x']], [24, 12, 8, 6])
    assert_array_equal(d[2 ** d.id['x']], [2, 4, 8, 16])
dataset/ETHPy150Open glue-viz/glue/glue/core/tests/test_component_link.py/test_arithmetic_id_scalar/original