From 0a28d2898f92af4159c13af8a5c9488a0f9d766c Mon Sep 17 00:00:00 2001 From: Mithilesh Lohar <128236295+mithlohar144@users.noreply.github.com> Date: Mon, 30 Mar 2026 09:51:01 +0530 Subject: [PATCH 1/2] fix: validate plot_congestion.py CLI arguments Signed-off-by: Mithilesh Lohar <128236295+mithlohar144@users.noreply.github.com> --- flow/util/plot_congestion.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/flow/util/plot_congestion.py b/flow/util/plot_congestion.py index dfa0e600a1..af36b02554 100644 --- a/flow/util/plot_congestion.py +++ b/flow/util/plot_congestion.py @@ -4,9 +4,29 @@ import re import os +def usage(script): + print( + f"Usage: {script} ", + file=sys.stderr, + ) + print( + "Provide an even number of trailing arguments split equally between files and values.", + file=sys.stderr, + ) + + +if len(sys.argv) < 5: + usage(sys.argv[0]) + sys.exit(2) + sweep = sys.argv[1] output = sys.argv[2] remainder = sys.argv[3:] +if len(remainder) % 2 != 0: + print("Error: trailing arguments must be an even count.", file=sys.stderr) + usage(sys.argv[0]) + sys.exit(2) + files = remainder[: len(remainder) // 2] values = remainder[len(remainder) // 2 :] From e607af319f53b0515d915133c87a024190f1f9a0 Mon Sep 17 00:00:00 2001 From: Mithilesh Lohar <128236295+mithlohar144@users.noreply.github.com> Date: Mon, 30 Mar 2026 21:05:15 +0530 Subject: [PATCH 2/2] Format plot_congestion.py with black Signed-off-by: Mithilesh Lohar <128236295+mithlohar144@users.noreply.github.com> --- flow/util/plot_congestion.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flow/util/plot_congestion.py b/flow/util/plot_congestion.py index af36b02554..87413a26b3 100644 --- a/flow/util/plot_congestion.py +++ b/flow/util/plot_congestion.py @@ -4,6 +4,7 @@ import re import os + def usage(script): print( f"Usage: {script} ",