import logging


def metrics(time_dur, extremes, count, mean_hr, list_of_times,
            time, voltages):
    """Create a dictionary with the specified metrics

    Once all of the metrics have been determined, it is necessary to compile
    them all together. This is done through the generation of a dictionary.
    In the assignment, it is specified that the dictionary should contain
    the following information:
        duration: time duration of the ECG strip
        voltage_extremes: tuple in the form (min, max) where min and max are
            the minimum and maximum lead voltages found in the data file.
        num_beats: number of detected beats in the strip, as a numeric
            variable type.
        mean_hr_bpm: estimated average heart rate over the length of the strip
        beats: list of times when a beat occurred
    This function reads in each of these metrics and places each one into their
    respective keys as mentioned above. Then, once all of the information
    has been added to the dictionary, it is returned.


    Parameters
    ----------
    time_dur : float
        Contains duration of ECG strip in seconds
    extremes : tuple
        Contains the minimum and maximum voltages from the ECG strip
    count : int
        Value containing the number of peaks present
    mean_hr : float
        Contains the average heart rate (beats per minute)
    list_of_times : list
        Contains floats that match the times at which peaks occurred

    Returns
    -------
    dictionary
        Contains all of the metrics necessary
    """
    logging.info("Dictionary being established")
    metrics_dict = {"duration": time_dur,
                    "voltage_extremes": extremes,
                    "num_beats": count,
                    "mean_hr_bpm": mean_hr,
                    "beats": list_of_times,
                    "times": time,
                    "voltages": voltages}
    logging.info("Dictionary filled")
    return metrics_dict