def test_absolute_asym_comp_uncertainty(self):
properties = self.load_properties('testfile_uncertainty.yaml')
with pytest.warns(UserWarning) as record:
d = DataPoint(properties[0])
m = str(record.pop(UserWarning).message)
assert m == ('Asymmetric uncertainties are not supported. The maximum of lower-uncertainty '
'and upper-uncertainty has been used as the symmetric uncertainty.')
assert np.isclose(d.composition[2]['amount'].value, Q_(99.0))
assert np.isclose(d.composition[2]['amount'].error, Q_(1.0))
with pytest.warns(UserWarning) as record:
d = DataPoint(properties[1])
m = str(record.pop(UserWarning).message)
assert m == ('Asymmetric uncertainties are not supported. The maximum of lower-uncertainty '
'and upper-uncertainty has been used as the symmetric uncertainty.')
assert np.isclose(d.composition[2]['amount'].value, Q_(99.0))
assert np.isclose(d.composition[2]['amount'].error, Q_(1.0))
评论列表
文章目录