def dms(degrees):
    """
    Calculate degrees, minutes, seconds representation from decimal degrees.

    Parameters
    ----------
    degrees : float

    Returns
    -------
    (int, int, float)
    """

    degrees_int = int(abs(degrees))	 # integer degrees
    degrees_frac = abs(degrees) - degrees_int  # fractional degrees, used to compute minutes
    minutes_int = float(int(degrees_frac * 60))  # integer minutes
    minutes_frac = degrees_frac - minutes_int / 60  # fractional minutes, used to compute seconds
    seconds = minutes_frac * 3600  # decimal seconds

    # Handle sign.  Degrees portion will contain the sign of the coordinate.
    # Minutes and seconds will always be positive.
    # sign function returns -1, 0, +1 for x < 0, x == 0, x > 0, respectively
    if degrees < 0:
        degrees_int *= -1

    return degrees_int, minutes_int, seconds