bolt/utils.py
def istransposeable(new, old):
    """
    Check to see if a proposed tuple of axes is a valid permutation
    of an old set of axes. Checks length, axis repetion, and bounds.

    Parameters
    ----------
    new : tuple
        tuple of proposed axes

    old : tuple
        tuple of old axes
    """

    new, old = tupleize(new), tupleize(old)

    if not len(new) == len(old):
        raise ValueError("Axes do not match axes of keys")

    if not len(set(new)) == len(set(old)):
        raise ValueError("Repeated axes")

    if any(n < 0 for n in new) or max(new) > len(old) - 1:
        raise ValueError("Invalid axes")
def istransposeable(new, old):
    """
    Check to see if a proposed tuple of axes is a valid permutation
    of an old set of axes. Checks length, axis repetion, and bounds.

    Parameters
    ----------
    new : tuple
        tuple of proposed axes

    old : tuple
        tuple of old axes
    """

    new, old = tupleize(new), tupleize(old)

    if not len(new) == len(old):
        raise ValueError("Axes do not match axes of keys")

    if not len(set(new)) == len(set(old)):
        raise ValueError("Repeated axes")

    if any(n < 0 for n in new) or max(new) > len(old) - 1:
        raise ValueError("Invalid axes")
Check to see if a proposed tuple of axes is a valid permutation
    of an old set of axes. Checks length, axis repetion, and bounds.

    Parameters
    ----------
    new : tuple
        tuple of proposed axes

    old : tuple
        tuple of old axes