fix: String conversion of Obs can now handle a dvalue that is NaN or inf (#173)

This commit is contained in:
s-kuberski 2023-05-03 16:30:59 +02:00 committed by GitHub
parent ccd911fd17
commit 15d07de87f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -1254,7 +1254,9 @@ def test_format_uncertainty():
assert pe.obs._format_uncertainty(0.548, 2.48497, 2) == '0.5(2.5)'
assert pe.obs._format_uncertainty(0.548, 2.48497, 4) == '0.548(2.485)'
assert pe.obs._format_uncertainty(0.548, 20078.3, 9) == '0.5480(20078.3000)'
pe.obs._format_uncertainty(np.NaN, 1)
pe.obs._format_uncertainty(1, np.NaN)
pe.obs._format_uncertainty(np.NaN, np.inf)
def test_format():
o1 = pe.pseudo_Obs(0.348, 0.0123, "test")