Skip to content

Commit

Permalink
read_precomputed: deal with potentially malformed info vertex attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Oct 24, 2023
1 parent 8ec6be7 commit 4225c0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions navis/io/precomputed_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 4225c0d

Please sign in to comment.