mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 06:40:24 +01:00
feat: _asser_equal_properties improved by removing one for loop
This commit is contained in:
parent
c3ba07280b
commit
59137785ed
1 changed files with 3 additions and 2 deletions
|
@ -73,10 +73,11 @@ def gen_correlated_data(means, cov, name, tau=0.5, samples=1000):
|
|||
|
||||
|
||||
def _assert_equal_properties(ol, otype=Obs):
|
||||
for o in ol:
|
||||
if not isinstance(ol[0], otype):
|
||||
raise Exception("Wrong data type in list.")
|
||||
for o in ol[1:]:
|
||||
if not isinstance(o, otype):
|
||||
raise Exception("Wrong data type in list.")
|
||||
for o in ol[1:]:
|
||||
if not ol[0].is_merged == o.is_merged:
|
||||
raise Exception("All Obs in list have to be defined on the same set of configs.")
|
||||
if not ol[0].reweighted == o.reweighted:
|
||||
|
|
Loading…
Add table
Reference in a new issue