[yoda-svn] yoda: 3 new changesets

YODA Mercurial yoda at projects.hepforge.org
Tue Mar 8 13:30:02 GMT 2016


details:   https://yoda.hepforge.org/hg/yoda/rev/79fb972581f9
branches:  release-1-5
changeset: 1218:79fb972581f9
user:      Andy Buckley <andy at insectnation.org>
date:      Tue Mar 08 13:21:30 2016 +0000
description:
Trivial cosmetic

details:   https://yoda.hepforge.org/hg/yoda/rev/3afdb1ea6f6f
branches:  release-1-5
changeset: 1219:3afdb1ea6f6f
user:      Andy Buckley <andy at insectnation.org>
date:      Tue Mar 08 13:21:47 2016 +0000
description:
Handle different object dimensionalities in yodadiff

details:   https://yoda.hepforge.org/hg/yoda/rev/260b0cc86fb1
branches:  release-1-5
changeset: 1220:260b0cc86fb1
user:      Andy Buckley <andy at insectnation.org>
date:      Tue Mar 08 13:22:09 2016 +0000
description:
Hide development for\d\d\d dirs from hg

diffs (truncated from 93 to 50 lines):

--- a/.hgignore	Mon Feb 29 15:13:12 2016 +0000
+++ b/.hgignore	Tue Mar 08 13:22:09 2016 +0000
@@ -71,3 +71,4 @@
 ^tmp/
 ^pydoc/
 ^pyext/yoda/.made_pyx_templates$
+^for\d\d\d$
--- a/bin/yodadiff	Mon Feb 29 15:13:12 2016 +0000
+++ b/bin/yodadiff	Tue Mar 08 13:22:09 2016 +0000
@@ -44,12 +44,17 @@
     # TODO: Be careful with values on either side of zero. Add abs tolerance "epsilon" term?
     return (float(a) - float(b))/(float(a) + float(b)) < opts.TOL
 
-def s2str(s):
-    ptstr1 = "{x:.2g} + {ex[0]:.2g} - {ex[1]:.2g}"
-    ptstr2 = "{x:.2g} +- {ex[0]:.2g}"
-    xstr = (ptstr2 if eq(*s.xErrs) else ptstr1).format(x=s.x, ex=s.xErrs)
-    ystr = (ptstr2 if eq(*s.yErrs) else ptstr1).format(x=s.y, ex=s.yErrs)
-    return "({}, {})".format(xstr, ystr)
+def ptstr(pt):
+    vstr1 = "{x:.2g} + {ex[0]:.2g} - {ex[1]:.2g}"
+    vstr2 = "{x:.2g} +- {ex[0]:.2g}"
+    vstrs = []
+    if pt.dim >= 1:
+        vstrs.append( (vstr2 if eq(*pt.xErrs) else vstr1).format(x=pt.x, ex=pt.xErrs) )
+    if pt.dim >= 2:
+        vstrs.append( (vstr2 if eq(*pt.yErrs) else vstr1).format(x=pt.y, ex=pt.yErrs) )
+    if pt.dim >= 3:
+        vstrs.append( (vstr2 if eq(*pt.zErrs) else vstr1).format(x=pt.z, ex=pt.zErrs) )
+    return "(" + ", ".join(vstrs) + ")"
 
 ## Compare each object pair
 for path in sorted(set(aodict1.keys() + aodict2.keys())):
@@ -63,27 +68,43 @@
     if ao2 is None:
         print "Data object '%s' not found in %s" % (path, filenames[1])
         continue
+
     ## Compare the file #1 vs. #2 object types
     if type(ao1) is not type(ao2):
         print "Data objects with path '%s' have different types (%s and %s) in %s and %s" % \
               (path, str(type(ao1)), str(type(ao2)), filenames[0], filenames[1])
         continue
-    ## Compare the numbers of points/bins
-    # TODO: Fix the mapping so the exception can be caught in Python
+    ## Convert to scatter representations
     try:
-        s1 = ao1.mkScatter() if type(ao1) is not yoda.Scatter2D else ao1
-        s2 = ao2.mkScatter() if type(ao2) is not yoda.Scatter2D else ao2
+        s1 = ao1.mkScatter()


More information about the yoda-svn mailing list