r95380 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95379‎ | r95380 | r95381 >
Date:06:40, 24 August 2011
Author:giovanni
Status:deferred
Tags:
Comment:
find_peak returns geometric mean of peak
Modified paths:
  • /trunk/tools/wsor/editor_lifecycle/lifecycle/cvsmooth.py (modified) (history)

Diff [purge]

Index: trunk/tools/wsor/editor_lifecycle/lifecycle/cvsmooth.py
@@ -108,9 +108,12 @@
109109 kwds=kwds)
110110 results.append(res)
111111 results = np.asarray(map(ApplyResult.get, results))
112 - xerr = np.std(results[:,0], ddof=1, axis=0)
113 - # geometric standard deviation
114 - yerr = np.exp(np.std(np.log(results[:,1]), ddof=1))
 112+ if len(results):
 113+ xerr = np.std(results[:,0], ddof=1, axis=0)
 114+ # geometric standard deviation
 115+ yerr = np.exp(np.std(np.log(results[:,1]), ddof=1))
 116+ else:
 117+ xerr, yerr = np.nan, np.nan
115118 finally:
116119 pool.terminate()
117120 pool.join()

Status & tagging log