From afa15c461604cf4938de6dc155892c13f2aa8588 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 13 Nov 2020 12:31:45 -0500 Subject: [PATCH] Allocate space for 2d worth of 5s bars --- piker/data/_sharedmem.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/piker/data/_sharedmem.py b/piker/data/_sharedmem.py index 7f90d1ae..77dac544 100644 --- a/piker/data/_sharedmem.py +++ b/piker/data/_sharedmem.py @@ -214,10 +214,12 @@ class ShmArray: ... +_lotsa_5s = int(5*60*60*10/5) + def open_shm_array( key: Optional[str] = None, # approx number of 5s bars in a "day" x2 - size: int = int(2*60*60*10/5), + size: int = _lotsa_5s, dtype: Optional[np.dtype] = None, readonly: bool = False, ) -> ShmArray: @@ -269,7 +271,7 @@ def open_shm_array( def attach_shm_array( token: Tuple[str, str, Tuple[str, str]], - size: int = int(60*60*10/5), + size: int = _lotsa_5s, readonly: bool = True, ) -> ShmArray: """Load and attach to an existing shared memory array previously