From 2fdc17ecd3806ee435943c8c628c9ba75c2d0e51 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 4 Nov 2021 17:02:51 +0000 Subject: [PATCH] Corr.__str__ extended --- pyerrors/correlators.py | 5 ++++- pyerrors/input/hadrons.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index 059d8df6..1d11bedb 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -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' diff --git a/pyerrors/input/hadrons.py b/pyerrors/input/hadrons.py index c0619318..ac1bb78a 100644 --- a/pyerrors/input/hadrons.py +++ b/pyerrors/input/hadrons.py @@ -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