Corr.__str__ extended

This commit is contained in:
Fabian Joswig 2021-11-04 17:02:51 +00:00
parent 3466558c94
commit 2fdc17ecd3
2 changed files with 5 additions and 2 deletions

View file

@ -590,9 +590,12 @@ class Corr:
print(self.__repr__(range))
def __repr__(self, range=[0, None]):
content_string = ""
if self.tag is not None:
content_string += "Description: " + self.tag + "\n"
if range[1]:
range[1] += 1
content_string = 'x0/a\tCorr(x0/a)\n------------------\n'
content_string += 'x0/a\tCorr(x0/a)\n------------------\n'
for i, sub_corr in enumerate(self.content[range[0]:range[1]]):
if sub_corr is None:
content_string += str(i + range[0]) + '\n'

View file

@ -81,7 +81,7 @@ def read_meson_hd5(path, filestem, ens_id, meson='meson_0', tree='meson'):
l_obs.append(Obs([c], [ens_id]))
corr = Corr(l_obs)
corr.tag = ", ".join(infos)
corr.tag = r", ".join(infos)
return corr