def test_max_switch_time():
    'Tests max_switch_time option.'
    acc = mm.MOTAccumulator(max_switch_time=1)
    acc.update([1, 2], [1, 2], [[1, 0.5], [0.3, 1]], frameid=1)
    frameid = acc.update([1, 2], [1, 2], [[0.5, np.nan], [np.nan, 0.5]], frameid=2)
    df = acc.events.loc[frameid]
    assert (((df.Type == 'SWITCH') | (df.Type == 'RAW')) | (df.Type == 'TRANSFER')).all()
    acc = mm.MOTAccumulator(max_switch_time=1)
    acc.update([1, 2], [1, 2], [[1, 0.5], [0.3, 1]], frameid=1)
    frameid = acc.update([1, 2], [1, 2], [[0.5, np.nan], [np.nan, 0.5]], frameid=5)
    df = acc.events.loc[frameid]
    assert (((df.Type == 'MATCH') | (df.Type == 'RAW')) | (df.Type == 'TRANSFER')).all()
Tests max_switch_time option.
def test_max_switch_time():
    
    acc = mm.MOTAccumulator(max_switch_time=1)
    acc.update([1, 2], [1, 2], [[1, 0.5], [0.3, 1]], frameid=1)
    frameid = acc.update([1, 2], [1, 2], [[0.5, np.nan], [np.nan, 0.5]], frameid=2)
    df = acc.events.loc[frameid]
    assert (((df.Type == 'SWITCH') | (df.Type == 'RAW')) | (df.Type == 'TRANSFER')).all()
    acc = mm.MOTAccumulator(max_switch_time=1)
    acc.update([1, 2], [1, 2], [[1, 0.5], [0.3, 1]], frameid=1)
    frameid = acc.update([1, 2], [1, 2], [[0.5, np.nan], [np.nan, 0.5]], frameid=5)
    df = acc.events.loc[frameid]
    assert (((df.Type == 'MATCH') | (df.Type == 'RAW')) | (df.Type == 'TRANSFER')).all()