From 4225c0d4af6cbcfde7a774dc19b2513618dc7323 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Tue, 24 Oct 2023 17:16:07 +0100 Subject: [PATCH] read_precomputed: deal with potentially malformed info vertex attributes --- navis/io/precomputed_io.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/navis/io/precomputed_io.py b/navis/io/precomputed_io.py index b37c7e58..16ba36c2 100644 --- a/navis/io/precomputed_io.py +++ b/navis/io/precomputed_io.py @@ -151,6 +151,10 @@ def read_buffer( swc = self.make_swc(nodes, edges) + # Check for malformed vertex attributes (should be list of dicts) + if isinstance(self.info.get('vertex_attributes', None), dict): + self.info['vertex_attributes'] = [self.info['vertex_attributes']] + # Parse additional vertex attributes if specified as per the info file for attr in self.info.get('vertex_attributes', []): dtype = np.dtype(attr['data_type'])