Skip to content

Commit 5ed5c70

Browse files
committed
Replace separate checks for NaN and inf with all and isfinite
1 parent b9a273a commit 5ed5c70

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

jdaviz/configs/specviz/plugins/line_analysis/line_analysis.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ def _uncertainty(result):
271271
if getattr(result, 'uncertainty', None) is not None:
272272
# we'll keep the uncertainty and result in the same unit (so
273273
# we only have to show the unit at the end)
274-
if (np.any(np.isnan(result.uncertainty.value)) or
275-
np.any(np.isinf(result.uncertainty.value))):
274+
if not np.all(np.isfinite(result.uncertainty.value)):
276275
return ''
277276
return str(result.uncertainty.to_value(result.unit))
278277
else:

0 commit comments

Comments
 (0)