def test_metricscontainer_autodep():
    """Tests automatic dependencies from argument names."""
    m = mm.metrics.MetricsHost()
    m.register(lambda df: 1., name='a')
    m.register(lambda df: 2., name='b')
    m.register(lambda df, a, b: a + b, name='add', deps='auto')
    m.register(lambda df, a, b: a - b, name='sub', deps='auto')
    m.register(lambda df, add, sub: add * sub, name='mul', deps='auto')
    summary = m.compute(mm.MOTAccumulator.new_event_dataframe(), metrics=['mul', 'add'])
    assert summary.columns.values.tolist() == ['mul', 'add']
    assert summary.iloc[0]['mul'] == -3.
    assert summary.iloc[0]['add'] == 3.
Tests automatic dependencies from argument names.
motmetrics/tests/test_metrics.py