pypet/utils/comparisons.py
def results_equal(a, b):
    """Compares two result instances

    Checks full name and all data. Does not consider the comment.

    :return: True or False

    :raises: ValueError if both inputs are no result instances

    """
    if a.v_is_parameter and b.v_is_parameter:
        raise ValueError('Both inputs are not results.')

    if a.v_is_parameter or b.v_is_parameter:
        return False

    if a.v_full_name != b.v_full_name:
        return False

    if hasattr(a, '_data') and not hasattr(b, '_data'):
        return False

    if hasattr(a, '_data'):
        akeyset = set(a._data.keys())
        bkeyset = set(b._data.keys())

        if akeyset != bkeyset:
            return False

        for key in a._data:
            val = a._data[key]
            bval = b._data[key]

            if not nested_equal(val, bval):
                return False

    return True
def results_equal(a, b):
    if a.v_is_parameter and b.v_is_parameter:
        raise ValueError('Both inputs are not results.')

    if a.v_is_parameter or b.v_is_parameter:
        return False

    if a.v_full_name != b.v_full_name:
        return False

    if hasattr(a, '_data') and not hasattr(b, '_data'):
        return False

    if hasattr(a, '_data'):
        akeyset = set(a._data.keys())
        bkeyset = set(b._data.keys())

        if akeyset != bkeyset:
            return False

        for key in a._data:
            val = a._data[key]
            bval = b._data[key]

            if not nested_equal(val, bval):
                return False

    return True
def results_equal ( a , b ) : if a . v_is_parameter and b . v_is_parameter : raise ValueError ( 'Both inputs are not results.' ) if a . v_is_parameter or b . v_is_parameter : return False if a . v_full_name != b . v_full_name : return False if hasattr ( a , '_data' ) and not hasattr ( b , '_data' ) : return False if hasattr ( a , '_data' ) : akeyset = set ( a . _data . keys ( ) ) bkeyset = set ( b . _data . keys ( ) ) if akeyset != bkeyset : return False for key in a . _data : val = a . _data [ key ] bval = b . _data [ key ] if not nested_equal ( val , bval ) : return False return True
Compares two result instances

    Checks full name and all data. Does not consider the comment.

    :return: True or False

    :raises: ValueError if both inputs are no result instances
Compares two result instances