consistent handling of comments
This commit is contained in:
parent
dd44714387
commit
e15678e7a4
|
@ -31,7 +31,7 @@ class Table:
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""Brief overview."""
|
"""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):
|
def __len__(self):
|
||||||
"""Number of rows."""
|
"""Number of rows."""
|
||||||
|
@ -159,7 +159,7 @@ class Table:
|
||||||
comments = [util.execution_stamp('Table','from_ang')]
|
comments = [util.execution_stamp('Table','from_ang')]
|
||||||
for line in content:
|
for line in content:
|
||||||
if line.startswith('#'):
|
if line.startswith('#'):
|
||||||
comments.append(line.strip())
|
comments.append(line.split('#',1)[1].strip())
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -222,6 +222,7 @@ class Table:
|
||||||
dup.data[label] = data.reshape(dup.data[label].shape)
|
dup.data[label] = data.reshape(dup.data[label].shape)
|
||||||
return dup
|
return dup
|
||||||
|
|
||||||
|
|
||||||
def add(self,label,data,info=None):
|
def add(self,label,data,info=None):
|
||||||
"""
|
"""
|
||||||
Add column data.
|
Add column data.
|
||||||
|
|
Loading…
Reference in New Issue