From e15678e7a40eec238862e1684da17f916cb4520f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 12 Nov 2020 21:31:09 +0100 Subject: [PATCH] consistent handling of comments --- python/damask/_table.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/damask/_table.py b/python/damask/_table.py index e90650eea..c05fa71a7 100644 --- a/python/damask/_table.py +++ b/python/damask/_table.py @@ -31,7 +31,7 @@ class Table: def __repr__(self): """Brief overview.""" - return util.srepr(self.comments)+'\n'+self.data.__repr__() + return '\n'.join(['# '+c for c in self.comments])+'\n'+self.data.__repr__() def __len__(self): """Number of rows.""" @@ -159,7 +159,7 @@ class Table: comments = [util.execution_stamp('Table','from_ang')] for line in content: if line.startswith('#'): - comments.append(line.strip()) + comments.append(line.split('#',1)[1].strip()) else: break @@ -222,6 +222,7 @@ class Table: dup.data[label] = data.reshape(dup.data[label].shape) return dup + def add(self,label,data,info=None): """ Add column data.