def test_metricscontainer_1():
    """Tests registration of events with dependencies."""
    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, deps=['a', 'b'], name='add')
    m.register(lambda df, a, b: a - b, deps=['a', 'b'], name='sub')
    m.register(lambda df, a, b: a * b, deps=['add', 'sub'], name='mul')
    summary = m.compute(mm.MOTAccumulator.new_event_dataframe(), metrics=['mul', 'add'], name='x')
    assert summary.columns.values.tolist() == ['mul', 'add']
    assert summary.iloc[0]['mul'] == -3.
    assert summary.iloc[0]['add'] == 3.
Tests registration of events with dependencies.
motmetrics/tests/test_metrics.py