예제 #1
0
def to_output_table(relaxer, use_pd=True):
    if pd and use_pd:
        return as_df(relaxer)
    else:
        result = []
        prioritizer = relaxer.prioritizer
        for ct, relaxed in relaxer.iter_relaxations():
            result.append(TOutputTables(ct.name,
                                        prioritizer.get_priority_internal(ct).name,
                                        relaxed))
        return result
예제 #2
0
def to_output_table(relaxer, use_pd=True):
    columns = ['Constraint', 'Priority', 'Amount']
    if pd and use_pd:
        return as_df(relaxer)
    else:
        TOutputTables = namedtuple('TOutputTables', columns)
        result = []
        prioritizer = relaxer.prioritizer
        for ct, relaxed in relaxer.iter_relaxations():
            result.append(TOutputTables(ct.name,
                                        prioritizer.get_priority(ct).name,
                                        relaxed))
        return result