pipeline/evaluate.py
def write_matching(fpath, matching, scores, order='row'):
    """Take an array of values and interpet it either as row indices or column
    indices. It is assumed the matching was in order from 0 to len(matching).

    :param str fpath: Path of file to write matches to.
    :param arr matching: Iterable of ints, with each int being a row or col
        index, depending on the value of `order`.
    :param arr scores: Iterable of scores (floats) for each matching.
    :param str order: One of {'row','col'}. If 'row', the indices of `matching`
        are used as the column values, otherwise the indices are used as row
        values.
    """
    with open(fpath, 'w') as f:
        if order == 'row':
            matchings = ["%s,%s,%f" % (row, col, scores[col])
                         for col, row in enumerate(matching)]
        else:
            matchings = ["%s,%s,%f" % (row, col, scores[row])
                         for row, col in enumerate(matching)]
        f.write('\n'.join(matchings))
Take an array of values and interpet it either as row indices or column
    indices. It is assumed the matching was in order from 0 to len(matching).

    :param str fpath: Path of file to write matches to.
    :param arr matching: Iterable of ints, with each int being a row or col
        index, depending on the value of `order`.
    :param arr scores: Iterable of scores (floats) for each matching.
    :param str order: One of {'row','col'}. If 'row', the indices of `matching`
        are used as the column values, otherwise the indices are used as row
        values.
    
Take an array of values and interpet it either as row indices or column
indices. It is assumed the matching was in order from 0 to len(matching).
Take an array of values and interpet it either as row indices or column indices . It is assumed the matching was in order from 0 to len ( matching ) .
def write_matching(fpath, matching, scores, order='row'):
    with open(fpath, 'w') as f:
        if order == 'row':
            matchings = ["%s,%s,%f" % (row, col, scores[col])
                         for col, row in enumerate(matching)]
        else:
            matchings = ["%s,%s,%f" % (row, col, scores[row])
                         for row, col in enumerate(matching)]
        f.write('\n'.join(matchings))
def write_matching ( fpath , matching , scores , order = 'row' ) : with open ( fpath , 'w' ) as f : if order == 'row' : matchings = [ "%s,%s,%f" % ( row , col , scores [ col ] ) for col , row in enumerate ( matching ) ] else : matchings = [ "%s,%s,%f" % ( row , col , scores [ row ] ) for row , col in enumerate ( matching ) ] f . write ( '\n' . join ( matchings ) )
Take an array of values and interpet it either as row indices or column
indices.
Take an array of values and interpet it either as row indices or column indices .
"""Take an array of values and interpet it either as row indices or column
    indices. It is assumed the matching was in order from 0 to len(matching).

    :param str fpath: Path of file to write matches to.
    :param arr matching: Iterable of ints, with each int being a row or col
        index, depending on the value of `order`.
    :param arr scores: Iterable of scores (floats) for each matching.
    :param str order: One of {'row','col'}. If 'row', the indices of `matching`
        are used as the column values, otherwise the indices are used as row
        values.
    """
fpath
Path of file to write matches to.
Path of file to write matches to .
matching
Iterable of ints, with each int being a row or col
index, depending on the value of `order`.
Iterable of ints with each int being a row or col index depending on the value of ` order ` .
scores
Iterable of scores (floats) for each matching.
Iterable of scores ( floats ) for each matching .
order
None