Fixed combinations in closure() for older versions of Python dev
authorDmitriy Morozov <dmitriy@mrzv.org>
Fri, 28 Jan 2011 08:01:37 -0800
branchdev
changeset 241 2ca64ce7d57c
parent 240 ae6319bfb53d
child 242 a06b4b515476
Fixed combinations in closure() for older versions of Python
bindings/python/dionysus/__init__.py
--- a/bindings/python/dionysus/__init__.py	Fri Jan 07 23:11:46 2011 -0800
+++ b/bindings/python/dionysus/__init__.py	Fri Jan 28 08:01:37 2011 -0800
@@ -52,7 +52,7 @@
     from    itertools   import combinations
     for s in simplices:
         for kk in xrange(1, k+2):
-            for face in combinations(s.vertices, kk):
+            for face in combinations(s.vertices, min(s.dimension() + 1, kk)):
                 res.add(Simplex(face, s.data))
 
     return list(res)