Skip to content

Commit e055f5e

Browse files
authored
Merge pull request #459 from GaneshPatil7517/fix/lag-validation-379
fix: clamp lag parameter to buffer size with warning (fixes #379)
2 parents 58dfe63 + a4162b6 commit e055f5e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tools/plotymlag.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
import time
66

77
size = 10
8-
lag = concore.tryparam("lag", 0)
8+
lag = concore.tryparam("lag", 0)
9+
if lag >= size:
10+
logging.warning(
11+
"Requested lag (%d) exceeds buffer size (%d). Clamping to %d.",
12+
lag, size, size - 1
13+
)
14+
lag = size - 1
915
logging.info(f"plot ym with lag={lag}")
1016

1117
concore.delay = 0.005

0 commit comments

Comments
 (0)