Loading scripts/detect_regressions.py +14 −10 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ def main(args): rng = result.columns[3:] # Whole history else: rng = result.columns[-days:] result = result.dropna(subset=rng) result = result.dropna(subset=rng, how="all") result = result.reset_index(drop=True) ratio = result.copy() Loading @@ -87,11 +87,15 @@ def main(args): currdate = dates[-(days - i)] # Make robust for shorter history prevdate = dates[-(days - i + 1)] idx = ratio.groupby("format")[currdate].idxmax() # Get max ratio per format, skip formats with no data on this date col = ratio[["format", currdate]].dropna() if not col.empty: idx = col.groupby("format")[currdate].idxmax() all_indices.extend(idx.tolist()) # Store worst case per format for plotting for f in formats: if f in idx.index: plotdata.loc[f, currdate] = ratio.iloc[idx[f]][currdate] plottext.loc[f, currdate] = ( f"Job: {result.iloc[idx[f]]['job']}<br>Testcase: {result.iloc[idx[f]]['testcase']} <br>Max {measure} ratio: {ratio.iloc[idx[f]][currdate]:.2f}<br>Date: {currdate}" Loading Loading
scripts/detect_regressions.py +14 −10 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ def main(args): rng = result.columns[3:] # Whole history else: rng = result.columns[-days:] result = result.dropna(subset=rng) result = result.dropna(subset=rng, how="all") result = result.reset_index(drop=True) ratio = result.copy() Loading @@ -87,11 +87,15 @@ def main(args): currdate = dates[-(days - i)] # Make robust for shorter history prevdate = dates[-(days - i + 1)] idx = ratio.groupby("format")[currdate].idxmax() # Get max ratio per format, skip formats with no data on this date col = ratio[["format", currdate]].dropna() if not col.empty: idx = col.groupby("format")[currdate].idxmax() all_indices.extend(idx.tolist()) # Store worst case per format for plotting for f in formats: if f in idx.index: plotdata.loc[f, currdate] = ratio.iloc[idx[f]][currdate] plottext.loc[f, currdate] = ( f"Job: {result.iloc[idx[f]]['job']}<br>Testcase: {result.iloc[idx[f]]['testcase']} <br>Max {measure} ratio: {ratio.iloc[idx[f]][currdate]:.2f}<br>Date: {currdate}" Loading