[Rivet-svn] r1644 - trunk/bin

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Jun 25 16:12:15 BST 2009


Author: buckley
Date: Thu Jun 25 16:11:43 2009
New Revision: 1644

Log:
Give a bit of positive feedback: at the moment compare-histos only gives warnings that histos will not be written since there is only one copy (in either the ref data or MC file(s)), so I've increased this to say how many were successfully written (and to give a per-file log message at debug level).

Modified:
   trunk/bin/compare-histos

Modified: trunk/bin/compare-histos
==============================================================================
--- trunk/bin/compare-histos	Wed Jun 24 17:23:36 2009	(r1643)
+++ trunk/bin/compare-histos	Thu Jun 25 16:11:43 2009	(r1644)
@@ -405,6 +405,7 @@
     ## Write out histos
     ## For < 2.4 compatibility, since Set has no 'sort' method
     NAMES = [i for i in NAMES]
+    num_written = 0
     for name in sorted(NAMES):
         logging.debug("Writing histos for plot '%s'" % name)
 
@@ -431,7 +432,7 @@
 
         if len(activefiles) == 1 and opts.NO_REF_ONLY:
             logging.warning("Skipping histo '%s' since only one plot is present" % name)
-            continue        
+            continue 
 
         ## Identify reference file for this histo
         ref = opts.REF_ID
@@ -490,6 +491,9 @@
         ## Write file
         mkoutdir(outdir)
         outfilepath = os.path.join(outdir, outfilename)
+        logging.debug("Writing histo '%s' to %s" % (name, outfilepath))
         f = open(outfilepath, 'w')
         f.write(headstr + "\n" + "\n".join(histstrs))
         f.close()
+        num_written += 1
+    logging.info("Wrote %d histo files to %s" % (num_written, outdir))


More information about the Rivet-svn mailing list