use central functionality

This commit is contained in:
Martin Diehl 2020-08-24 23:28:26 +02:00
parent 71e08ea66a
commit 0ceba2a6d3
1 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,6 @@ import re
import pandas as pd import pandas as pd
import numpy as np import numpy as np
from . import version
from . import util from . import util
class Table: class Table:
@ -49,7 +48,9 @@ class Table:
def _add_comment(self,label,shape,info): def _add_comment(self,label,shape,info):
if info is not None: if info is not None:
self.comments.append(f'{label}{" "+str(shape) if np.prod(shape,dtype=int) > 1 else ""}: {info}') specific = f'{label}{" "+str(shape) if np.prod(shape,dtype=int) > 1 else ""}: {info}'
general = util.execution_stamp('Table')
self.comments.append(f'{specific} / {general}')
@staticmethod @staticmethod
@ -135,7 +136,7 @@ class Table:
content = f.readlines() content = f.readlines()
comments = [f'table.py:from_ang v{version}'] 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.strip())