r79210 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79209‎ | r79210 | r79211 >
Date:21:57, 29 December 2010
Author:rfaulk
Status:deferred
Tags:
Comment:
Fixed matplotlib issue with Decimal values in bar plot.
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/fundraiser_reporting.py (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/fundraiser_reporting.py
@@ -906,6 +906,8 @@
907907 start_time = times[0]
908908 end_time = times[1]
909909
 910+ print '\nGenerating ' + query_name +', start and end times are: ' + start_time + ' - ' + end_time +' ... \n'
 911+
910912 # Run Query
911913 return_val = self.run_query(start_time, end_time, query_name)
912914 counts = return_val[0]
@@ -920,8 +922,16 @@
921923 fname = query_name + '.png'
922924
923925 title = query_obj.get_plot_title(query_name)
 926+ title = title + ' -- ' + start_time + ' - ' + end_time
924927 ylabel = query_obj.get_plot_ylabel(query_name)
925928
 929+ # Convert counts to float (from Decimal) to prevent exception when bar plotting
 930+ # Bbox::update_numerix_xy expected numerix array
 931+ counts_new = list()
 932+ for i in range(len(counts)):
 933+ counts_new.append(float(counts[i]))
 934+ counts = counts_new
 935+
926936 # Generate Histogram
927937 self.gen_plot(counts, times, title, xlabel, ylabel, ranges, subplot_index, fname)
928938

Status & tagging log