From: W. Trevor King Date: Mon, 19 Nov 2012 12:35:48 +0000 (-0500) Subject: Convert "NaN" -> "nan" to catch up with Numpy 1.6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1c8f4dafddcbaac124fabee4aa2e8ed1d67f81c4;p=hooke.git Convert "NaN" -> "nan" to catch up with Numpy 1.6 This changed with Numpy commit: commit 1985497ddd1c179d5ae4b7ba061a8b8c5540f543 Author: Pauli Virtanen Date: Sun Jul 18 17:17:58 2010 +0000 BUG: core: format 'nan' and 'inf' also in array repr by default (#1050) --- diff --git a/hooke/util/si.py b/hooke/util/si.py index 9d6e910..67366c1 100644 --- a/hooke/util/si.py +++ b/hooke/util/si.py @@ -109,7 +109,7 @@ def ppSI(value, unit='', decimals=None, power=None, pad=False): if value == 0: return '0' if value == None or isnan(value): - return 'NaN' + return 'nan' if power == None: # auto-detect power power = get_power(value) diff --git a/test/polymer_fit.py b/test/polymer_fit.py index 39d7839..67128c7 100644 --- a/test/polymer_fit.py +++ b/test/polymer_fit.py @@ -77,22 +77,22 @@ Check the results. 'polymer peak 0 (N)', 'polymer peak 1 (N)', 'polymer peak 2 (N)', 'polymer peak 3 (N)', 'polymer peak 4 (N)', 'polymer peak 5 (N)'] >>> retract[:5,-2:] -Data([[ NaN, NaN], - [ NaN, NaN], - [ NaN, NaN], - [ NaN, NaN], - [ NaN, NaN]]) +Data([[ nan, nan], + [ nan, nan], + [ nan, nan], + [ nan, nan], + [ nan, nan]]) >>> retract[1097:1103,-2:] # doctest: +ELLIPSIS -Data([[ NaN, 5.2...e-10], - [ NaN, 5...e-10], - [ NaN, 6.1...e-10], - [ NaN, 6.2...e-10], - [ NaN, 7...e-10], - [ NaN, NaN]]) +Data([[ nan, 5.2...e-10], + [ nan, 5...e-10], + [ nan, 6.1...e-10], + [ nan, 6.2...e-10], + [ nan, 7...e-10], + [ nan, nan]]) >>> retract[-5:,-2:] -Data([[ NaN, NaN], - [ NaN, NaN], - [ NaN, NaN], - [ NaN, NaN], - [ NaN, NaN]]) +Data([[ nan, nan], + [ nan, nan], + [ nan, nan], + [ nan, nan], + [ nan, nan]]) """