mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 20:13:41 +02:00
Corr.__get_item__ now returns an Obs in case there is only one entry per
timeslice
This commit is contained in:
parent
f1529c1753
commit
67fc15e001
1 changed files with 7 additions and 3 deletions
|
@ -63,6 +63,10 @@ class Corr:
|
||||||
self.gamma_method()
|
self.gamma_method()
|
||||||
|
|
||||||
def __getitem__(self, idx):
|
def __getitem__(self, idx):
|
||||||
|
"""Return the content of timeslice idx"""
|
||||||
|
if len(self.content[idx]) == 1:
|
||||||
|
return self.content[idx][0]
|
||||||
|
else:
|
||||||
return self.content[idx]
|
return self.content[idx]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -250,7 +254,7 @@ class Corr:
|
||||||
on the configurations in obs[i].idl.
|
on the configurations in obs[i].idl.
|
||||||
"""
|
"""
|
||||||
new_content = []
|
new_content = []
|
||||||
for t_slice in self:
|
for t_slice in self.content:
|
||||||
if t_slice is None:
|
if t_slice is None:
|
||||||
new_content.append(None)
|
new_content.append(None)
|
||||||
else:
|
else:
|
||||||
|
@ -274,7 +278,7 @@ class Corr:
|
||||||
T_partner = parity * partner.reverse()
|
T_partner = parity * partner.reverse()
|
||||||
|
|
||||||
t_slices = []
|
t_slices = []
|
||||||
for x0, t_slice in enumerate(self - T_partner):
|
for x0, t_slice in enumerate((self - T_partner).content):
|
||||||
if t_slice is not None:
|
if t_slice is not None:
|
||||||
if not t_slice[0].is_zero_within_error(5):
|
if not t_slice[0].is_zero_within_error(5):
|
||||||
t_slices.append(x0)
|
t_slices.append(x0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue