From ac53a53786e9d0b86d4cebc7a3c1c48a1d7aabb4 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Thu, 5 Dec 2024 20:02:45 +0530 Subject: [PATCH] fix: check for mismatching ranges in benchmark csv --- scripts/block-import-stats.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/block-import-stats.py b/scripts/block-import-stats.py index b8ece7ff15..074e49f805 100644 --- a/scripts/block-import-stats.py +++ b/scripts/block-import-stats.py @@ -77,6 +77,13 @@ def formatBins(df: pd.DataFrame, bins: int): start = max(min(baseline.index), min(contender.index)) end = min(max(baseline.index), max(contender.index)) +# Check if there's any overlap in the time ranges +if start > max(max(baseline.index), max(contender.index)) or end < min(min(baseline.index), min(contender.index)): + print(f"Error: No overlapping time ranges between baseline and contender datasets") + print(f"Baseline range: {min(baseline.index)} to {max(baseline.index)}") + print(f"Contender range: {min(contender.index)} to {max(contender.index)}") + exit(1) + baseline = baseline.loc[baseline.index >= start and baseline.index <= end] contender = contender.loc[contender.index >= start and contender.index <= end]