From 0a1a9ce1a168728cd7ca9444676639466c8454b7 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Wed, 9 Feb 2022 11:33:16 +0000 Subject: [PATCH] docs: docstrings and comments cleaned up --- pyerrors/correlators.py | 6 +----- pyerrors/obs.py | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index 352af782..694dc9a5 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -39,7 +39,7 @@ class Corr: region indentified for this correlator. """ - if isinstance(data_input, np.ndarray): # Input is an array of Corrs + if isinstance(data_input, np.ndarray): # This only works, if the array fulfills the conditions below if not len(data_input.shape) == 2 and data_input.shape[0] == data_input.shape[1]: @@ -95,7 +95,6 @@ class Corr: # An undefined timeslice is represented by the None object self.content = [None] * padding[0] + self.content + [None] * padding[1] self.T = len(self.content) - self.prange = prange self.gamma_method() @@ -160,9 +159,6 @@ class Corr: raise Exception("Vectors are of wrong shape!") if normalize: vector_l, vector_r = vector_l / np.sqrt((vector_l @ vector_l)), vector_r / np.sqrt(vector_r @ vector_r) - # if (not (0.95 < vector_r @ vector_r < 1.05)) or (not (0.95 < vector_l @ vector_l < 1.05)): - # print("Vectors are normalized before projection!") - newcontent = [None if (item is None) else np.asarray([vector_l.T @ item @ vector_r]) for item in self.content] else: diff --git a/pyerrors/obs.py b/pyerrors/obs.py index 94748ed6..08c8f291 100644 --- a/pyerrors/obs.py +++ b/pyerrors/obs.py @@ -1301,7 +1301,7 @@ def correlate(obs_a, obs_b): Keep in mind to only correlate primary observables which have not been reweighted yet. The reweighting has to be applied after correlating the observables. - Currently only works if ensembles are identical. This is not really necessary. + Currently only works if ensembles are identical (this is not strictly necessary). """ if sorted(obs_a.names) != sorted(obs_b.names): @@ -1462,7 +1462,7 @@ def covariance(obs1, obs2, correlation=False, **kwargs): def pseudo_Obs(value, dvalue, name, samples=1000): - """Generate a pseudo Obs with given value, dvalue and name + """Generate an Obs object with given value, dvalue and name for test purposes Parameters ----------