[Yt-svn] yt-commit r1783 - trunk/yt/lagos

sskory at wrangler.dreamhost.com sskory at wrangler.dreamhost.com
Tue Jun 29 15:47:01 PDT 2010


Author: sskory
Date: Tue Jun 29 15:47:00 2010
New Revision: 1783
URL: http://yt.enzotools.org/changeset/1783

Log:
Making the two point functions a bit more tolerant of differences in functions.

Modified:
   trunk/yt/lagos/TwoPointFunctions.py

Modified: trunk/yt/lagos/TwoPointFunctions.py
==============================================================================
--- trunk/yt/lagos/TwoPointFunctions.py	(original)
+++ trunk/yt/lagos/TwoPointFunctions.py	Tue Jun 29 15:47:00 2010
@@ -796,7 +796,14 @@
             for d1 in range(dim):
                 multi *= self.bin_edges[d1].size
             if dim == 0 and len(self.out_labels)==1:
-                digi = na.digitize(results, self.bin_edges[dim])
+                try:
+                    digi = na.digitize(results, self.bin_edges[dim])
+                except ValueError:
+                    # The user probably did something like 
+                    # return a * b rather than
+                    # return a[0] * b[0], which will only happen
+                    # for single field functions.
+                    digi = na.digitize(results[0], self.bin_edges[dim])
             else:
                 digi = na.digitize(results[:,dim], self.bin_edges[dim])
             too_low = (digi == 0)



More information about the yt-svn mailing list