Return a constant indicating the type of coupling.

    Depending on the type of coupling, one of the constants from
    :class:`.CouplingClass` is returned.

    Args:
        coupling: Tuple of minimum and maximum flux ratio

def classify_coupling(coupling):
    """Return a constant indicating the type of coupling.

    Depending on the type of coupling, one of the constants from
    :class:`.CouplingClass` is returned.

    Args:
        coupling: Tuple of minimum and maximum flux ratio
    """
    lower, upper = coupling

    if lower is None and upper is None:
        return CouplingClass.Uncoupled
    elif lower is None or upper is None:
        return CouplingClass.DirectionalReverse
    elif lower == 0.0 and upper == 0.0:
        return CouplingClass.Inconsistent
    elif lower <= 0.0 and upper >= 0.0:
        return CouplingClass.DirectionalForward
    elif abs(lower - upper) < 1e-6:
        return CouplingClass.Full
    else:
        return CouplingClass.Partial