[Rivet] rivet-cmphistos: '=' in the PLOT parameter

Dmitry Kalinkin dmitry.kalinkin at gmail.com
Wed Sep 28 07:32:12 BST 2016


Hi all,

There is a bug that prevents user from using ‘=‘ symbol in PLOT:Title=foo=bar:… It fails with:
ValueError: too many values to unpack
It would be nice to fix that (possibly using fix below).

Thanks,

Dmitry

diff a/bin/rivet-cmphistos b/bin/rivet-cmphistos
--- a/bin/rivet-cmphistos
+++ b/bin/rivet-cmphistos
@@ -371,7 +371,9 @@ if __name__ == '__main__':
         #     plot[key] = val
         if plotoptions.has_key("PLOT"):
             for key_val in plotoptions["PLOT"]:
-                key, val = [s.strip() for s in key_val.split("=")]
+                pos = key_val.index("=")
+                key = key_val[:pos].strip()
+                val = key_val[pos+1:].strip()
                 plot[key] = val
         if opts.LINEAR:
             plot['LogY'] = '0'


More information about the Rivet mailing list