[mlpack-svn] r15636 - mlpack/conf/jenkins-conf/benchmark/util
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Aug 19 09:20:20 EDT 2013
Author: marcus
Date: Mon Aug 19 09:20:19 2013
New Revision: 15636
Log:
Adjust plot parameters to create correct plots.
Modified:
mlpack/conf/jenkins-conf/benchmark/util/database.py
mlpack/conf/jenkins-conf/benchmark/util/graph.py
Modified: mlpack/conf/jenkins-conf/benchmark/util/database.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/util/database.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/util/database.py Mon Aug 19 09:20:19 2013
@@ -357,7 +357,9 @@
def GetMemoryResults(self, buildId, libaryId, methodId):
with self.con:
- self.cur.execute("SELECT * FROM memory JOIN datasets ON memory.dataset_id = datasets.id WHERE libary_id=" + str(libaryId) + " AND build_id="+ str(buildId) + " AND method_id=" + str(methodId))
+ self.cur.execute("SELECT * FROM memory JOIN datasets ON " +
+ "memory.dataset_id = datasets.id WHERE libary_id=" + str(libaryId) +
+ " AND build_id="+ str(buildId) + " AND method_id=" + str(methodId))
return self.cur.fetchall()
'''
Modified: mlpack/conf/jenkins-conf/benchmark/util/graph.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/util/graph.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/util/graph.py Mon Aug 19 09:20:19 2013
@@ -169,7 +169,8 @@
# Create the legend above the bar chart.
lgd = ax.legend(chartHandler, legendNames, loc='upper center',
- bbox_to_anchor=(0.5, 1.3), fancybox=True, shadow=False, ncol=8, fontsize=8)
+ bbox_to_anchor=(0.5, 1.3 + (0.2 * len(legendNames) / 6)), fancybox=True,
+ shadow=False, ncol=6, fontsize=8)
lgd.get_frame().set_linewidth(0)
for label in lgd.get_texts():
label.set_color("#6e6e6e")
@@ -199,6 +200,18 @@
@param backgroundColor - The color of the image background.
'''
def GenerateSingleLineChart(data, fileName, backgroundColor="#FFFFFF"):
+ def NormalizeData(data):
+ i = 0
+ while len(data) != i:
+ if not data[i]:
+ if i > 0 and data[i -1]:
+ data[i] = data[i - 1]
+ else:
+ del data[i]
+ i -= 1
+ i += 1
+ return data
+
if not CheckFileAvailable(fileName):
# Line chart settings.
lineWidth = 1.5
@@ -229,6 +242,8 @@
myLocator = mticker.MultipleLocator(1)
ax.xaxis.set_major_locator(myLocator)
+ data = NormalizeData(data)
+
# If we have only have a single value we don't want to start from zero so we
# double the data.
if len(data) == 1:
@@ -324,4 +339,4 @@
# Save the memory chart.
fig.savefig(fileName, bbox_extra_artists=(lgd,), bbox_inches='tight',
facecolor=fig.get_facecolor(), edgecolor='none', format='png')
- plt.close()
+ plt.close()
More information about the mlpack-svn
mailing list