import logging


def create_dict(timespan, extremes, numbeats, mean_hr, beat_times):
    """Creates metrics dictionary with key ECG information

    The metrics dictionary contains the the following info:
    duration: float, voltage_extremes: float tuple, num_beats:
    int, mean_hr_bpm: int, beats: list of floats

    Args:
        timespan (float): time duration of ECG strip
        extremes (float tuple): (min, max) of lead voltages in file
        numbeats (int): number of detected beats in file
        mean_hr (int): average heart rate over file length
        beat_times (list of floats): times when beat occurred

    Returns:
        dict: metrics dictionary with ECG statistics of the input file
    """
    logging.info("Assigning dictionary entries")
    metrics = {"duration": timespan, "voltage_extremes": extremes,
               "num_beats": numbeats, "mean_hr_bpm": mean_hr,
               "beats": beat_times}
    return metrics