def test_summary_reader_iterate():
    """@TODO: Docs. Contribution is welcome."""
    reader = SummaryReader("logs", types=["scalar"])
    _, data_raw = _get_test_data()
    data_raw2 = 2 * [d for d in data_raw if d is not None]
    items = list(reader)

    assert len(items) == len(data_raw2)

    for item, event_raw in zip(items, data_raw2):
        assert item.step == event_raw["step"]
        assert item.tag == event_raw["tag"]
        assert item.type == event_raw["type"]
        assert np.all(item.value == event_raw["value"])
def test_summary_reader_invalid_type():
    """@TODO: Docs. Contribution is welcome."""
    with pytest.raises(ValueError):
        SummaryReader(".", types=["unknown-type"])