diff --git a/docs/pyerrors/misc.html b/docs/pyerrors/misc.html index 12a14342..de71352e 100644 --- a/docs/pyerrors/misc.html +++ b/docs/pyerrors/misc.html @@ -192,19 +192,14 @@ 105 106 107def _assert_equal_properties(ol, otype=Obs): -108 if not isinstance(ol[0], otype): -109 raise Exception("Wrong data type in list.") -110 for o in ol[1:]: -111 if not isinstance(o, otype): -112 raise Exception("Wrong data type in list.") -113 if not ol[0].is_merged == o.is_merged: -114 raise Exception("All Obs in list have to have the same state 'is_merged'.") -115 if not ol[0].reweighted == o.reweighted: -116 raise Exception("All Obs in list have to have the same property 'reweighted'.") -117 if not ol[0].e_content == o.e_content: -118 raise Exception("All Obs in list have to be defined on the same set of configs.") -119 if not ol[0].idl == o.idl: -120 raise Exception("All Obs in list have to be defined on the same set of configurations.") +108 otype = type(ol[0]) +109 for o in ol[1:]: +110 if not isinstance(o, otype): +111 raise Exception("Wrong data type in list.") +112 for attr in ["is_merged", "reweighted", "e_content", "idl"]: +113 if hasattr(ol[0], attr): +114 if not getattr(ol[0], attr) == getattr(o, attr): +115 raise Exception(f"All Obs in list have to have the same state '{attr}'.")