[pypy-commit] pypy default: better organization, and show data for numpy.generic as well

alex_gaynor noreply at buildbot.pypy.org
Fri Jan 27 01:36:09 CET 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r51841:8276de5ece4c
Date: 2012-01-26 19:35 -0500
http://bitbucket.org/pypy/pypy/changeset/8276de5ece4c/

Log:	better organization, and show data for numpy.generic as well

diff --git a/pypy/module/micronumpy/tool/numready/main.py b/pypy/module/micronumpy/tool/numready/main.py
--- a/pypy/module/micronumpy/tool/numready/main.py
+++ b/pypy/module/micronumpy/tool/numready/main.py
@@ -73,9 +73,8 @@
     for line in lines:
         kind, name = line.split(" : ", 1)
         subitems = None
-        if kind == KINDS["TYPE"]:
-            if name in ['ndarray', 'dtype']:
-                subitems = find_numpy_items(python, modname, name)
+        if kind == KINDS["TYPE"] and name in SPECIAL_NAMES and attr is None:
+            subitems = find_numpy_items(python, modname, name)
         items.add(Item(name, kind, subitems))
     return items
 
@@ -89,15 +88,20 @@
                 l[i].append(lst[k * lgt + i])
     return l
 
+SPECIAL_NAMES = ["ndarray", "dtype", "generic"]
+
 def main(argv):
     cpy_items = find_numpy_items("/usr/bin/python")
     pypy_items = find_numpy_items(argv[1], "numpypy")
     all_items = []
 
-    msg = '%d/%d names, %d/%d ndarray attributes, %d/%d dtype attributes' % (
-        len(pypy_items), len(cpy_items), len(pypy_items['ndarray'].subitems),
-        len(cpy_items['ndarray'].subitems), len(pypy_items['dtype'].subitems),
-        len(cpy_items['dtype'].subitems))
+    msg = "{:d}/{:d} names".format(len(pypy_items), len(cpy_items))
+    msg += ", ".join(
+        "{:d}/{:d} {} attributes".format(
+            len(pypy_items[name].subitems), len(cpy_items[name].subitems), name
+        )
+        for name in SPECIAL_NAMES
+    )
     for item in cpy_items:
         pypy_exists = item in pypy_items
         if item.subitems:


More information about the pypy-commit mailing list