Did I find the right examples for you? yes no

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)

src/n/i/nitime-0.4/nitime/tests/test_timeseries.py   nitime(Download)
def test_get_time_unit():
 
    number = 4
    npt.assert_equal(ts.get_time_unit(number), None)
 
    list_of_numbers = [4, 5, 6]
    npt.assert_equal(ts.get_time_unit(list_of_numbers), None)
    for tu in ['ps', 's', 'D']:
        time_point = ts.TimeArray([4], time_unit=tu)
        npt.assert_equal(ts.get_time_unit(time_point), tu)
 
        list_of_time = [ts.TimeArray(4, time_unit=tu), ts.TimeArray(5, time_unit=tu)]
        npt.assert_equal(ts.get_time_unit(list_of_time), tu)
                         ts.TimeArray(5, time_unit=tu)]]
 
        npt.assert_equal(ts.get_time_unit(list_of_lists), tu)
        time_arr = ts.TimeArray([4, 5], time_unit=tu)
        npt.assert_equal(ts.get_time_unit(time_arr), tu)

src/n/i/nitime-HEAD/nitime/tests/test_timeseries.py   nitime(Download)
def test_get_time_unit():
 
    number = 4
    npt.assert_equal(ts.get_time_unit(number), None)
 
    list_of_numbers = [4, 5, 6]
    npt.assert_equal(ts.get_time_unit(list_of_numbers), None)
    for tu in ['ps', 's', 'D']:
        time_point = ts.TimeArray([4], time_unit=tu)
        npt.assert_equal(ts.get_time_unit(time_point), tu)
 
        list_of_time = [ts.TimeArray(4, time_unit=tu), ts.TimeArray(5, time_unit=tu)]
        npt.assert_equal(ts.get_time_unit(list_of_time), tu)
                         ts.TimeArray(5, time_unit=tu)]]
 
        npt.assert_equal(ts.get_time_unit(list_of_lists), tu)
        time_arr = ts.TimeArray([4, 5], time_unit=tu)
        npt.assert_equal(ts.get_time_unit(time_arr), tu)