mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
fix: String conversion of Obs can now handle a dvalue that is NaN or inf (#173)
This commit is contained in:
parent
ccd911fd17
commit
15d07de87f
2 changed files with 4 additions and 2 deletions
|
@ -978,7 +978,7 @@ class CObs:
|
|||
|
||||
def _format_uncertainty(value, dvalue, significance=2):
|
||||
"""Creates a string of a value and its error in paranthesis notation, e.g., 13.02(45)"""
|
||||
if dvalue == 0.0:
|
||||
if dvalue == 0.0 or (not np.isfinite(dvalue)):
|
||||
return str(value)
|
||||
if not isinstance(significance, int):
|
||||
raise TypeError("significance needs to be an integer.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue