From 595c8026bf6587792e579b3a802eb244ddb760c1 Mon Sep 17 00:00:00 2001 From: xenofem Date: Thu, 24 Feb 2022 00:38:04 -0500 Subject: [PATCH] make sure we have enough samples before checking termination inactivity threshold --- impatient | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/impatient b/impatient index b285cf7..0240e7e 100755 --- a/impatient +++ b/impatient @@ -132,6 +132,11 @@ while True: ), end='') sys.stdout.flush() - if final and current >= args.termination_value_threshold*final and all(d == 0 for d in deltas[-args.termination_inactivity_threshold:]): + if ( + final + and current >= args.termination_value_threshold*final + and len(deltas) >= args.termination_inactivity_threshold + and all(d == 0 for d in deltas[-args.termination_inactivity_threshold:]) + ): print() break