def test_metrics_with_no_events():
    """Tests metrics when accumulator is empty."""
    acc = mm.MOTAccumulator()

    mh = mm.metrics.create()
    metr = mh.compute(acc, return_dataframe=False, return_cached=True, metrics=[
        'mota', 'motp', 'num_predictions', 'num_objects', 'num_detections', 'num_frames',
    ])
    assert np.isnan(metr['mota'])
    assert np.isnan(metr['motp'])
    assert metr['num_predictions'] == 0
    assert metr['num_objects'] == 0
    assert metr['num_detections'] == 0
    assert metr['num_frames'] == 0
Tests metrics when accumulator is empty.
motmetrics/tests/test_metrics.py