def test_TimeArray_comparison():
    "Comparison with unitless quantities should convert to TimeArray units"
    time = ts.TimeArray(list(range(10)), time_unit='ms')
    npt.assert_equal(time < 5 , [True]*5+[False]*5)
    npt.assert_equal(time > 5 , [False]*6+[True]*4)
    npt.assert_equal(5 <= time, [True]*6+[False]*4)
    npt.assert_equal(time >= 5, [False]*5+[True]*5)
    npt.assert_equal(time == 5, [False]*5+[True] + [False]*4)
    time.convert_unit('s')
    # now all of time is < 1 in the new time_unit
    npt.assert_equal(time < 5 , [True]*10)
    npt.assert_equal(time > 5 , [False]*10)
    npt.assert_equal(time <= 5, [True]*10)
    npt.assert_equal(time >= 5, [False]*10)
    npt.assert_equal(time == 5, [False]*10)
dataset/ETHPy150Open nipy/nitime/nitime/tests/test_timeseries.py/test_TimeArray_comparison/swapped operands of `<=`