From 00028724b8f2e3131d3af950b700069187e628d6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 2 Mar 2020 23:20:36 +0100 Subject: [PATCH] type is float for empty element in prod, should always be int --- python/damask/table.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/damask/table.py b/python/damask/table.py index 15b501ac9..a4badb3dc 100644 --- a/python/damask/table.py +++ b/python/damask/table.py @@ -32,7 +32,7 @@ class Table(): """Label data individually, e.g. v v v ==> 1_v 2_v 3_v.""" labels = [] for label,shape in self.shapes.items(): - size = np.prod(shape) + size = int(np.prod(shape)) labels += ['{}{}'.format('' if size == 1 else '{}_'.format(i+1),label) for i in range(size)] self.data.columns = labels @@ -41,14 +41,14 @@ class Table(): """Label data condensed, e.g. 1_v 2_v 3_v ==> v v v.""" labels = [] for label,shape in self.shapes.items(): - labels += [label] * np.prod(shape) + labels += [label] * int(np.prod(shape)) self.data.columns = labels def __add_comment(self,label,shape,info): if info is not None: self.comments.append('{}{}: {}'.format(label, - ' '+str(shape) if np.prod(shape) > 1 else '', + ' '+str(shape) if np.prod(shape,dtype=int) > 1 else '', info))