def test_inequality():
    d = Data(x=[1, 2, 3, 4], y=[10, 20, 10, 20])
    s = d.new_subset()

    xpy = d.id['x'] + d.id['y']
    twentytwo = xpy * 0 + 22
    x = d[d.id['x']]
    y = d[d.id['y']]

    s.subset_state = xpy < 22
    assert_array_equal(s.to_mask(), (x + y) < 22)

    s.subset_state = xpy <= 22
    assert_array_equal(s.to_mask(), (x + y) <= 22)

    s.subset_state = xpy >= 22
    assert_array_equal(s.to_mask(), (x + y) >= 22)

    s.subset_state = xpy > 22
    assert_array_equal(s.to_mask(), (x + y) > 22)

    s.subset_state = 22 < xpy
    assert_array_equal(s.to_mask(), 22 < (x + y))

    s.subset_state = 22 <= xpy
    assert_array_equal(s.to_mask(), 22 <= (x + y))

    s.subset_state = 22 > xpy
    assert_array_equal(s.to_mask(), 22 > (x + y))

    s.subset_state = 22 >= xpy
    assert_array_equal(s.to_mask(), 22 >= (x + y))

    s.subset_state = twentytwo < xpy
    assert_array_equal(s.to_mask(), 22 < (x + y))

    s.subset_state = twentytwo <= xpy
    assert_array_equal(s.to_mask(), 22 <= (x + y))

    s.subset_state = xpy > twentytwo
    assert_array_equal(s.to_mask(), 22 > (x + y))

    s.subset_state = twentytwo >= xpy
    assert_array_equal(s.to_mask(), 22 >= (x + y))
dataset/ETHPy150Open glue-viz/glue/glue/core/tests/test_component_link.py/test_inequality/swapped operands of `>`