mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
Quick fix to corr.m_eff(). Zero values no longer produce errors but are handled as nones in m_eff().
This commit is contained in:
parent
0d02e4d4b9
commit
bd6c0a223b
1 changed files with 3 additions and 3 deletions
|
@ -602,7 +602,7 @@ class Corr:
|
|||
if variant == 'log':
|
||||
newcontent = []
|
||||
for t in range(self.T - 1):
|
||||
if (self.content[t] is None) or (self.content[t + 1] is None):
|
||||
if ((self.content[t] is None) or (self.content[t + 1] is None)) or (self.content[t + 1][0].value == 0):
|
||||
newcontent.append(None)
|
||||
else:
|
||||
newcontent.append(self.content[t] / self.content[t + 1])
|
||||
|
@ -622,7 +622,7 @@ class Corr:
|
|||
|
||||
newcontent = []
|
||||
for t in range(self.T - 1):
|
||||
if (self.content[t] is None) or (self.content[t + 1] is None):
|
||||
if (self.content[t] is None) or (self.content[t + 1] is None) or (self.content[t + 1][0].value == 0):
|
||||
newcontent.append(None)
|
||||
# Fill the two timeslices in the middle of the lattice with their predecessors
|
||||
elif variant == 'sinh' and t in [self.T / 2, self.T / 2 - 1]:
|
||||
|
@ -637,7 +637,7 @@ class Corr:
|
|||
elif variant == 'arccosh':
|
||||
newcontent = []
|
||||
for t in range(1, self.T - 1):
|
||||
if (self.content[t] is None) or (self.content[t + 1] is None) or (self.content[t - 1] is None):
|
||||
if (self.content[t] is None) or (self.content[t + 1] is None) or (self.content[t - 1] is None) or (self.content[t + 1][0].value == 0) or (self.content[t - 1][0].value == 0):
|
||||
newcontent.append(None)
|
||||
else:
|
||||
newcontent.append((self.content[t + 1] + self.content[t - 1]) / (2 * self.content[t]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue