* Documentation & test update.

This commit is contained in:
Wirawan Purwanto
2014-10-15 10:12:49 -04:00
parent d841380864
commit 4f82c80af9
2 changed files with 10 additions and 0 deletions

View File

@@ -76,6 +76,8 @@ def generate_float_indices(arr, rdiff_threshold, debug=0):
a_sorted[0] = a_sorted[1] # dummy data
a_diff = numpy.diff(a_sorted) # == a_sorted[1:] - a_sorted[:-1]
a_avg_abs = (numpy.abs(a_sorted[1:]) + numpy.abs(a_sorted[:-1])) * 0.5
# FIXME: handle case where a_avg_abs is truly ZERO -> in this case
# the abs should be 1.
a_rdiff = numpy.abs(a_diff) / a_avg_abs
# hack the first rdiff since this element *must* always be present,
# so this trick marks it as "unique":