[Blends-commit] r2743 - in /blends/trunk/team_analysis_tools: create_bad_names.sql upload_history.py

tille at users.alioth.debian.org tille at users.alioth.debian.org
Sun Apr 10 05:57:17 UTC 2011


Author: tille
Date: Sun Apr 10 05:57:14 2011
New Revision: 2743

URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=2743
Log:
Drop the "bad_names" approach and use rather "names_prefered"

Modified:
    blends/trunk/team_analysis_tools/create_bad_names.sql
    blends/trunk/team_analysis_tools/upload_history.py

Modified: blends/trunk/team_analysis_tools/create_bad_names.sql
URL: http://svn.debian.org/wsvn/blends/blends/trunk/team_analysis_tools/create_bad_names.sql?rev=2743&op=diff
==============================================================================
--- blends/trunk/team_analysis_tools/create_bad_names.sql (original)
+++ blends/trunk/team_analysis_tools/create_bad_names.sql Sun Apr 10 05:57:14 2011
@@ -748,6 +748,7 @@
     JOIN (SELECT * FROM carnivore_names
            WHERE id IN (SELECT idupl FROM active_uploader_ids_of_pkggroup($1, $2) AS (idupl int, count int))
     )  cn ON ce.id    = cn.id
+    JOIN carnivore_names_prefered cnp ON cn.id = cnp.id
    WHERE source IN (           -- source packages that are maintained by the team
       SELECT DISTINCT source FROM upload_history
       WHERE maintainer_email = $1
@@ -758,13 +759,18 @@
         JOIN carnivore_emails ce ON ce.email = uh.changed_by_email
        WHERE maintainer_email = $1
      )
-     AND cn.name NOT IN (SELECT name FROM carnivore_bad_names WHERE id = cn.id )
+     AND cn.name = cnp.name
    GROUP BY cn.name, uh.year
    ORDER BY year, count DESC, cn.name
 $$ LANGUAGE 'SQL';
 
 -- top 10 maintainers as (hopefully!!!) unique name
 CREATE OR REPLACE FUNCTION active_uploader_names_of_pkggroup(text, int) RETURNS SETOF RECORD AS $$
-  SELECT (SELECT name FROM carnivore_names WHERE name NOT IN (SELECT name FROM carnivore_bad_names WHERE id = idupl ) AND id = idupl) AS name
+  SELECT (SELECT name FROM carnivore_names WHERE name IN (SELECT name FROM carnivore_names_prefered WHERE id = idupl ) AND id = idupl) AS name
     FROM active_uploader_ids_of_pkggroup($1, $2) AS (idupl int, count int)
 $$ LANGUAGE 'SQL';
+
+/*
+SELECT * FROM active_uploader_names_of_pkggroup('debian-med-packaging at lists.alioth.debian.org',50) AS (name text);
+SELECT * FROM active_uploader_names_of_pkggroup('debian-science-maintainers at lists.alioth.debian.org',50) AS (name text);
+*/

Modified: blends/trunk/team_analysis_tools/upload_history.py
URL: http://svn.debian.org/wsvn/blends/blends/trunk/team_analysis_tools/upload_history.py?rev=2743&op=diff
==============================================================================
--- blends/trunk/team_analysis_tools/upload_history.py (original)
+++ blends/trunk/team_analysis_tools/upload_history.py Sun Apr 10 05:57:14 2011
@@ -2,23 +2,26 @@
 # Copyright 2011: Andreas Tille <tille at debian.org>
 # License: GPL
 
+# MAXUPLOADERS=20
+MAXUPLOADERS=10
+
 teams = { 
-          'debian-med' :       ('debian-med-packaging at lists.alioth.debian.org',       10),
-          'debian-science':    ('debian-science-maintainers at lists.alioth.debian.org', 10),
-          'debichem':          ('debichem-devel at lists.alioth.debian.org',              8),
-          'debian-gis':        ('pkg-grass-devel at lists.alioth.debian.org',            10),
-          'pkg-multimedia':    ('pkg-multimedia-maintainers at lists.alioth.debian.org', 10),
-          'pkg-java':          ('pkg-java-maintainers at lists.alioth.debian.org',       10),
-###          'debian-live':       ('debian-live at lists.debian.org',                        2), # that's no real team but one very active person
-          'pkg-perl':          ('pkg-perl-maintainers at lists.alioth.debian.org',       10),
-###          'python-maint':      ('pkg-python-debian-maint at lists.alioth.debian.org',     4), # that's also no real team
-          'python-modules':    ('python-modules-team at lists.alioth.debian.org',        10),
-###          'debian-python':     ('debian-python at lists.debian.org',                      1), # that's only one person
-          'python-apps':       ('python-apps-team at lists.alioth.debian.org',           10),
-          'pkg-phototools':    ('pkg-phototools-devel at lists.alioth.debian.org',        8),
-          'pkg-scicomp':       ('pkg-scicomp-devel at lists.alioth.debian.org',          10),
-          'pkg-common-lisp':   ('pkg-common-lisp-devel at lists.alioth.debian.org',      10),
-          'ocaml-maintainers': ('debian-ocaml-maint at lists.debian.org',                10),
+          'debian-med' :       'debian-med-packaging at lists.alioth.debian.org'      ,
+          'debian-science':    'debian-science-maintainers at lists.alioth.debian.org',
+          'debichem':          'debichem-devel at lists.alioth.debian.org'            ,
+          'debian-gis':        'pkg-grass-devel at lists.alioth.debian.org'           ,
+          'pkg-multimedia':    'pkg-multimedia-maintainers at lists.alioth.debian.org',
+          'pkg-java':          'pkg-java-maintainers at lists.alioth.debian.org'      ,
+          'debian-live':       'debian-live at lists.debian.org'                      , # that's no real team but one very active person
+          'pkg-perl':          'pkg-perl-maintainers at lists.alioth.debian.org'      ,
+          'python-maint':      'pkg-python-debian-maint at lists.alioth.debian.org'   , # that's also no real team
+          'python-modules':    'python-modules-team at lists.alioth.debian.org'       ,
+          'debian-python':     'debian-python at lists.debian.org'                    , # that's only one person
+          'python-apps':       'python-apps-team at lists.alioth.debian.org'          ,
+          'pkg-phototools':    'pkg-phototools-devel at lists.alioth.debian.org'      ,
+          'pkg-scicomp':       'pkg-scicomp-devel at lists.alioth.debian.org'         ,
+          'pkg-common-lisp':   'pkg-common-lisp-devel at lists.alioth.debian.org'     ,
+          'ocaml-maintainers': 'debian-ocaml-maint at lists.debian.org'               ,
         }
 
 #teams = {
@@ -73,18 +76,19 @@
 for team in teams.keys():
     datafile='uploaders_'+team+'.txt'
     out = open(datafile, 'w')
-    query = """SELECT replace(uploader,' ','_') AS uploader
-  FROM active_uploader_names_of_pkggroup('%s', %i) AS (uploader text);
-""" % (teams[team][0], teams[team][1])
+    query = "SELECT replace(uploader,' ','_') AS uploader FROM active_uploader_names_of_pkggroup('%s', 1000) AS (uploader text);" % (teams[team])
+    # print query
     curs.execute(query)
 
     print >>out, ' year',
+    nuploaders = 0
     for row in curs.fetchall():
         print >>out, '\t' + sub('^(.*_\w)[^_]*$', '\\1', row[0]),
+        nuploaders += 1
     print >>out, ''
 
     typestring = 'year text'
-    for i in range(teams[team][1]):
+    for i in range(nuploaders):
         typestring = typestring + ', upl' + str(i+1) + ' int'
     query = """SELECT *
 	FROM 
@@ -93,7 +97,7 @@
                      FROM active_uploader_per_year_of_pkggroup(''%s'', %i) AS (name text, year int, count int)',
              'SELECT * FROM active_uploader_names_of_pkggroup(''%s'', %i) AS (category text)'
         ) As (%s)
-""" % (teams[team][0], teams[team][1], teams[team][0], teams[team][1], typestring)
+""" % (teams[team], nuploaders, teams[team], nuploaders, typestring)
 
     try:
         curs.execute(query)
@@ -109,5 +113,5 @@
                 print >>out, '\t0',
         print >>out, ''
     out.close()
-    system('./author_stats_create_graph ' + datafile + ' ' + str(teams[team][1]) + ' "Uploaders of ' + team + ' team"')
+    system('./author_stats_create_graph ' + datafile + ' ' + str(min(nuploaders, MAXUPLOADERS)) + ' "Uploaders of ' + team + ' team"')
 




More information about the Blends-commit mailing list