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
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