Commits

Nicolas Dumazet  committed 0fbb30c

reduce memory footprint

  • Participants
  • Parent commits acaa60d

Comments (0)

Files changed (1)

File statistics.py

         # keys: category (quality cat, or importance cat)
         # values: Page set
         artByCat = defaultdict(set)
-        # keys: article title
-        # values: [importance, quality] 2-element list
-        articles = defaultdict(lambda: [None, None])
 
 # At some point I planned to output diffs between successive evaluations
+#
+#        # keys: article title
+#        # values: [importance, quality] 2-element list
+#        articles = defaultdict(lambda: [None, None])
+#
 #        saveEval = pywikibot.config.datafilepath('eval', u'%s.dat' % project)
 #        try:
 #            f = open(saveEval, 'r')
             catname = cat_importance % (prefix, imp)
             cat = pywikibot.Page(site, catname)
             for p in site.categorymembers(cat, namespaces=[1]):
-                artByCat[imp].add(p)
-                articles[p.title()][0] = imp
+                title = p.title()
+                artByCat[imp].add(title)
+                # articles[title][0] = imp
             lenCat = len(artByCat[imp])
             results[project].importanceSum(i, catname, lenCat)
             total += lenCat
             catname = cat_quality % (prefix, av)
             cat = pywikibot.Page(site, catname)
             for p in site.categorymembers(cat, namespaces=[1]):
-                artByCat[av].add(p)
-                try:
-                    articles[p.title()][1] = av
-                except KeyError:
-                    pass
+                title = p.title()
+                artByCat[av].add(title)
+                # try:
+                #     articles[title][1] = av
+                # except KeyError:
+                #     pass
             results[project].qualitySum(i, catname, len(artByCat[av]))
 
         # perform intersections for center of the table