def heart_rate_zones(pulse, maxpulse=187):
    """Calculate heart rate zones.

    Parameters
    ----------
    pulse : int (or float)
        The heart rate to converte into a heart rate zone.
    maxpulse : int (or float), optional
        The maximal heart rate.

    Returns
    -------
    out[0] : float
        The heart rate zone.
    out[1] : float
        The heart rate zone, rounded to an integer.
    out[2] : float
        The fraction of the heart rate to the max heart rate.

    """
    frac = float(pulse) / float(maxpulse)
    zone = 10.0 * frac - 4.0
    if zone < 1.0:
        zone = 1.0
    if zone > 5.0:
        zone = 5.0
    return zone, int(zone), frac
