def test_arithmetic_id_link():
    d = Data(x=[1, 2, 3, 4], y=[10, 20, 10, 20])
    y10 = d.id['y'] / 10
    assert_array_equal(d[d.id['x'] + y10], [2, 4, 4, 6])
    assert_array_equal(d[d.id['x'] - y10], [0, 0, 2, 2])
    assert_array_equal(d[d.id['x'] * y10], [1, 4, 3, 8])
    assert_array_equal(d[d.id['x'] / y10], [1, 1, 3, 2])
    assert_array_equal(d[d.id['x'] ** y10], [1, 4, 3, 16])

    assert_array_equal(d[y10 + d.id['x']], [2, 4, 4, 6])
    assert_array_equal(d[y10 - d.id['x']], [0, 0, -2, -2])
    assert_array_equal(d[y10 * d.id['x']], [1, 4, 3, 8])
    assert_array_equal(d[d.id['x'] / y10], [1, 1, 1 / 3., 1 / 2.])
    assert_array_equal(d[y10 ** d.id['x']], [1, 4, 1, 16])
dataset/ETHPy150Open glue-viz/glue/glue/core/tests/test_component_link.py/test_arithmetic_id_link/swapped operands of `/`