feat: _asser_equal_properties improved by removing one for loop

This commit is contained in:
Fabian Joswig 2022-01-19 13:18:44 +00:00
parent c3ba07280b
commit 59137785ed

View file

@ -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(o, otype):
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.")
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: