[Piuparts-commits] [piuparts] 07/12: p-r: plot all states

Holger Levsen holger at layer-acht.org
Mon Mar 13 12:39:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit bef4eb0f4c83a514346e15ce24c2447c5beea23b
Author: Andreas Beckmann <anbe at debian.org>
Date:   Wed Mar 8 07:33:11 2017 +0100

    p-r: plot all states
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog   |  1 +
 piuparts-report.py | 13 ++++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5df3951..7b554bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ piuparts (0.77) UNRELEASED; urgency=medium
   * piuparts-slave.py:
   * piuparts-analyze.py:
   * piuparts-report.py:
+    - Plot all states in the graphs.
 
  -- Andreas Beckmann <anbe at debian.org>  Sun, 12 Mar 2017 23:30:21 +0100
 
diff --git a/piuparts-report.py b/piuparts-report.py
index c5cb0ad..e2c9a28 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -3,7 +3,7 @@
 #
 # Copyright 2005 Lars Wirzenius (liw at iki.fi)
 # Copyright 2009-2014 Holger Levsen (holger at layer-acht.org)
-# Copyright © 2011-2016 Andreas Beckmann (anbe at debian.org)
+# Copyright © 2011-2017 Andreas Beckmann (anbe at debian.org)
 # Copyright 2013 David Steele (dsteele at gmail.com)
 #
 # This program is free software; you can redistribute it and/or modify it
@@ -1230,20 +1230,23 @@ class Section:
         grdevices = importr('grDevices')
         grdevices.png(file=pngfile, width=1600, height=900, pointsize=10, res=100, antialias="none")
         r = robjects.r
+        states = self._binary_db.get_states()
+        r('nstate = %d' % len(states))
         r('t <- (read.table("' + countsfile + '",sep=",",header=1,row.names=1))')
         r('cname <- c("date",rep(colnames(t)))')
         # here we define how many days we wants stats for (163=half a year)
-        # r('v <- t[(nrow(t)-163):nrow(t),0:12]')
+        # r('v <- t[(nrow(t)-163):nrow(t),0:nstate]')
         # make graph since day 1
-        r('v <- t[0:nrow(t),0:12]')
+        r('v <- t[0:nrow(t),0:nstate]')
         # thanks to http://tango.freedesktop.org/Generic_Icon_Theme_Guidelines for those nice colors
+        r('palsize = 13')
         r('palette(c("#4e9a06", "#ef2929", "#d3d7cf", "#5c3566", "#c4a000", \
                      "#fce94f", "#a40000", "#888a85", "#2e3436", "#729fcf", \
                      "#3465a4", "#204a87", "#555753"))')
-        r('barplot(t(v),col = 1:13, \
+        r('barplot(t(v),col = 1:palsize, \
           main="Binary packages per state in ' + self._config.section + '", \
           xlab="", ylab="Number of binary packages", space=0, border=NA)')
-        r('legend(x="bottom",legend=colnames(t), ncol=2,fill=1:13,xjust=0.5,yjust=0,bty="n")')
+        r('legend(x="bottom",legend=colnames(t), ncol=2,fill=1:palsize,xjust=0.5,yjust=0,bty="n")')
         grdevices.dev_off()
 
         stats_html = "<tr class=\"normalrow\"> " \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list