@staticmethod
def format_peak_constraints(peak, attr):
    """Returns a string representing the peak's attribute's constraints.
        """
    constraints = peak.get_constraints(attr)
    if constraints['value'] is None:
        return ''
    cstring = ''
    if constraints['expr']:
        cstring += str(constraints['expr'])
    elif not constraints['vary']:
        cstring += '{}'.format(constraints['value'])
    else:
        if constraints['min'] not in (float('-inf'), 0):
            cstring += '> {} '.format(constraints['min'])
        if constraints['max'] != float('inf'):
            cstring += '< {}'.format(constraints['max'])
    return cstring
