[Rivet-svn] rivet: 2 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Thu Dec 17 16:45:01 GMT 2015


details:   https://rivet.hepforge.org/hg/rivet/rev/35dbe15ff932
branches:  release-2-4-x
changeset: 4958:35dbe15ff932
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Dec 17 16:30:41 2015 +0000
description:
Relax cmphistos path pattern matching definition to allow more characters in the main part

details:   https://rivet.hepforge.org/hg/rivet/rev/54772904718c
branches:  release-2-4-x
changeset: 4959:54772904718c
user:      Andy Buckley <andy at insectnation.org>
date:      Thu Dec 17 16:38:43 2015 +0000
description:
Better testing that supplied filenames exist, for rivet-cmphistos and make-plots

diffs (38 lines):

--- a/bin/make-plots	Wed Dec 16 16:25:35 2015 +0000
+++ b/bin/make-plots	Thu Dec 17 16:38:43 2015 +0000
@@ -2555,6 +2555,11 @@
         logging.error(parser.get_usage())
         sys.exit(2)
 
+    ## Check that the files exist
+    for f in args:
+        if not os.access(f, os.R_OK):
+            print "Error: cannot read from %s" % f
+            sys.exit(1)
 
     ## Test for external programs (kpsewhich, latex, dvips, ps2pdf/ps2eps, and convert)
     opts.LATEXPKGS = []
--- a/bin/rivet-cmphistos	Wed Dec 16 16:25:35 2015 +0000
+++ b/bin/rivet-cmphistos	Thu Dec 17 16:38:43 2015 +0000
@@ -98,7 +98,7 @@
     refhistos = {}
     mchistos = {}
     import re
-    re_path = re.compile(r"^/(REF/)?([\w/]+)(\[\d+\])?$")
+    re_path = re.compile(r"^/(REF/)?([^\[\]\@\#]+)(\[\d+\])?$")
     for infile in filelist:
         mchistos.setdefault(infile, {})
         analysisobjects = yoda.read(infile, patterns=opts.PATHPATTERNS, unpatterns=opts.PATHUNPATTERNS)
@@ -275,6 +275,12 @@
     if "PLOT" in filelist:
         filelist.remove("PLOT")
 
+    ## Check that the files exist
+    for f in filelist:
+        if not os.access(f, os.R_OK):
+            print "Error: cannot read from %s" % f
+            sys.exit(1)
+
     ## Read the .plot files
     plotdirs = opts.PLOTINFODIRS + [os.path.abspath(os.path.dirname(f)) for f in filelist]
     plotparser = rivet.mkStdPlotParser(plotdirs, opts.CONFIGFILES)


More information about the Rivet-svn mailing list