From 3455ebc60c62abdac4fe411e69665ec216d2d188 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 14 Jun 2021 00:03:05 -0400 Subject: [PATCH] Cast back to tuples after msgspec strips them... --- piker/data/_sharedmem.py | 3 +-- piker/data/feed.py | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/piker/data/_sharedmem.py b/piker/data/_sharedmem.py index b4e6de86..aa2a5320 100644 --- a/piker/data/_sharedmem.py +++ b/piker/data/_sharedmem.py @@ -97,8 +97,7 @@ class _Token: def __post_init__(self): # np.array requires a list for dtype - self.dtype_descr = np.dtype( - list(self.dtype_descr)).descr + self.dtype_descr = np.dtype(list(map(tuple, self.dtype_descr))).descr def as_msg(self): return asdict(self) diff --git a/piker/data/feed.py b/piker/data/feed.py index 0f856627..4a41500d 100644 --- a/piker/data/feed.py +++ b/piker/data/feed.py @@ -514,7 +514,10 @@ async def open_feed( # cast shm dtype to list... can't member why we need this shm_token = data['shm_token'] - shm_token['dtype_descr'] = list(shm_token['dtype_descr']) + + # XXX: msgspec won't relay through the tuples XD + shm_token['dtype_descr'] = list(map(tuple, shm_token['dtype_descr'])) + assert shm_token == shm.token # sanity feed._max_sample_rate = max(ohlc_sample_rates)