def test_TimeArray_div():

    #divide singelton by singleton:
    a = 2.0
    b = 6.0
    time1 = ts.TimeArray(a, time_unit='s')
    time2 = ts.TimeArray(b, time_unit='s')
    div1 = a / b
    #This should eliminate the units and return a float, not a TimeArray:
    div2 = time1 / time2
    npt.assert_equal(div1, div2)

    #Divide a TimeArray by a singelton:
    a = np.array([1, 2, 3])
    b = 6.0
    time1 = ts.TimeArray(a, time_unit='s')
    time2 = ts.TimeArray(b, time_unit='s')
    div1 = a / b
    #This should eliminate the units and return a float array, not a TimeArray:
    div2 = time1 / time2
    npt.assert_equal(div1, div2)

    #Divide a TimeArray by another TimeArray:
    a = np.array([1, 2, 3])
    b = np.array([2, 2, 2]).astype(float)  # TimeArray division is float division!
    time1 = ts.TimeArray(a, time_unit='s')
    time2 = ts.TimeArray(b, time_unit='s')
    div1 = a / b
    #This should eliminate the units and return a float array, not a TimeArray:
    div2 = time1 / time2
    npt.assert_equal(div1, div2)
dataset/ETHPy150Open nipy/nitime/nitime/tests/test_timeseries.py/test_TimeArray_div/original