mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
fix: get_item and reweighted now work with padded correlators.
This commit is contained in:
parent
d2911afa31
commit
bc220fceaf
1 changed files with 4 additions and 2 deletions
|
@ -65,14 +65,16 @@ class Corr:
|
|||
|
||||
def __getitem__(self, idx):
|
||||
"""Return the content of timeslice idx"""
|
||||
if len(self.content[idx]) == 1:
|
||||
if self.content[idx] is None:
|
||||
return None
|
||||
elif len(self.content[idx]) == 1:
|
||||
return self.content[idx][0]
|
||||
else:
|
||||
return self.content[idx]
|
||||
|
||||
@property
|
||||
def reweighted(self):
|
||||
bool_array = np.array([list(map(lambda x: x.reweighted, o)) for o in self.content])
|
||||
bool_array = np.array([list(map(lambda x: x.reweighted, o)) for o in list(filter(None.__ne__, self.content))])
|
||||
if np.all(bool_array == 1):
|
||||
return True
|
||||
elif np.all(bool_array == 0):
|
||||
|
|
Loading…
Add table
Reference in a new issue