def parseversion(version):
    """ Method to parse a version string from an AT or a BDP to turn it into ints so it can
        be easily compared.

        Parameters
        ----------
        version : str
            The string to parse

        Returns
        -------
            Tuple containing the major, minor, and sub version numbers (all ints)

    """
    # split the string into the components
    parse = version.split(".")
    # if all three components are present
    if len(parse) == 3:
        major = int(parse[0])
        minor = int(parse[1])
        sub   = int(parse[2])
    # if only two are present
    elif len(parse) == 2:
        major = int(parse[0])
        minor = int(parse[1])
        sub   = 0
    # if only one is present
    elif len(parse) == 1:
        major = int(parse[0])
        minor = 0
        sub   = 0
    else:
        raise Exception("Improperly formatted version string, it must conatin 1, 2, or 3 ints.")

    return (major, minor, sub)