mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-16 23:30:24 +01:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
10b7ada53d
1 changed files with 4 additions and 7 deletions
|
@ -53,7 +53,7 @@ class Obs:
|
||||||
N_sigma_dict = {}
|
N_sigma_dict = {}
|
||||||
filter_eps = 1e-10
|
filter_eps = 1e-10
|
||||||
|
|
||||||
def __init__(self, samples, names, idl=None, means=None, **kwargs):
|
def __init__(self, samples, names, idl=None, **kwargs):
|
||||||
""" Initialize Obs object.
|
""" Initialize Obs object.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
|
@ -64,12 +64,9 @@ class Obs:
|
||||||
list of strings labeling the individual samples
|
list of strings labeling the individual samples
|
||||||
idl : list, optional
|
idl : list, optional
|
||||||
list of ranges or lists on which the samples are defined
|
list of ranges or lists on which the samples are defined
|
||||||
means : list, optional
|
|
||||||
list of mean values for the case that the mean values were
|
|
||||||
already subtracted from the samples
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if means is None and len(samples):
|
if kwargs.get("means") is None and len(samples):
|
||||||
if len(samples) != len(names):
|
if len(samples) != len(names):
|
||||||
raise Exception('Length of samples and names incompatible.')
|
raise Exception('Length of samples and names incompatible.')
|
||||||
if idl is not None:
|
if idl is not None:
|
||||||
|
@ -115,8 +112,8 @@ class Obs:
|
||||||
|
|
||||||
self._value = 0
|
self._value = 0
|
||||||
self.N = 0
|
self.N = 0
|
||||||
if means is not None:
|
if kwargs.get("means") is not None:
|
||||||
for name, sample, mean in sorted(zip(names, samples, means)):
|
for name, sample, mean in sorted(zip(names, samples, kwargs.get("means"))):
|
||||||
self.shape[name] = len(self.idl[name])
|
self.shape[name] = len(self.idl[name])
|
||||||
self.N += self.shape[name]
|
self.N += self.shape[name]
|
||||||
self.r_values[name] = mean
|
self.r_values[name] = mean
|
||||||
|
|
Loading…
Add table
Reference in a new issue