From 02df55b9bde2d94c2caacf4a4a9ecac8f5dd7e35 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Nov 2019 11:18:41 +0100 Subject: [PATCH] bugfix casting to plain array works only (and makes sense only) for a derived type --- python/damask/dadf5.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/damask/dadf5.py b/python/damask/dadf5.py index 69b19fefd..d879946eb 100644 --- a/python/damask/dadf5.py +++ b/python/damask/dadf5.py @@ -401,8 +401,11 @@ class DADF5(): if len(a.shape) == 1: a=a.reshape([a.shape[0],1]) dataset[p,:] = a[u,:] - - return dataset if not plain else dataset.view(('float64',len(dataset.dtype.names))) + + if plain and dataset.dtype.names is not None: + return dataset.view(('float64',len(dataset.dtype.names))) + else: + return dataset def cell_coordinates(self):