def samples_to_siminsp_row(table, colmap={}, **sampdict): row = table.RowType() row.simulation_id = table.get_next_id() for key, col in CMAP.iteritems(): if key not in sampdict: continue if isinstance(col, types.FunctionType): col(row, sampdict[key]) else: setattr(row, col, sampdict[key]) return row
def likelihood_to_snglinsp_row(table, loglikelihood, neff=0, converged=False, **cols): row = table.RowType() row.event_id = table.get_next_id() for col in cols: setattr(row, col, cols[col]) row.snr = loglikelihood row.tau0 = neff row.tau3 = int(converged) return row