|
[Rivet-svn] r2489 - in trunk: . bin datablackhole at projects.hepforge.org blackhole at projects.hepforge.orgSat Jun 19 15:18:53 BST 2010
Author: buckley Date: Sat Jun 19 15:19:03 2010 New Revision: 2489 Log: * Adding --analysis-path and --analysis-path-append command-line flags to the rivet script, as a "persistent" way to set or extend the RIVET_ANALYSIS_PATH variable. * Changing -Q/-V script verbosity arguments to more standard -q/-v, after Hendrik moaned about it ;) Modified: trunk/ChangeLog trunk/bin/aida2flat trunk/bin/compare-histos trunk/bin/make-plots trunk/bin/rivet trunk/bin/rivet-chopbins trunk/bin/rivet-mergeruns trunk/bin/rivet-mkanalysis trunk/bin/rivet-rescale trunk/bin/rivetgrid trunk/data/rivet-completion Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/ChangeLog Sat Jun 19 15:19:03 2010 (r2489) @@ -1,5 +1,12 @@ 2010-06-19 Andy Buckley <andy at insectnation.org> + * Adding --analysis-path and --analysis-path-append command-line + flags to the rivet script, as a "persistent" way to set or extend + the RIVET_ANALYSIS_PATH variable. + + * Changing -Q/-V script verbosity arguments to more standard + -q/-v, after Hendrik moaned about it ;) + * Small fix to TinyXML operator precendence: removes a warning, and I think fixes a small bug. Modified: trunk/bin/aida2flat ============================================================================== --- trunk/bin/aida2flat Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/aida2flat Sat Jun 19 15:19:03 2010 (r2489) @@ -61,9 +61,9 @@ help="Only write out histograms whose $path/$name string matches these regexes", dest="PATHPATTERNS") verbgroup = OptionGroup(parser, "Verbosity control") - verbgroup.add_option("-V", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", + verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", default=logging.INFO, help="print debug (very verbose) messages") - verbgroup.add_option("-Q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", + verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", default=logging.INFO, help="be very quiet") opts, args = parser.parse_args() Modified: trunk/bin/compare-histos ============================================================================== --- trunk/bin/compare-histos Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/compare-histos Sat Jun 19 15:19:03 2010 (r2489) @@ -96,9 +96,9 @@ default="REF", help="ID of reference data set (file path for non-REF data)") parser.add_option("--plot-info-dir", dest="PLOTINFODIR", action="append", default=["./", rivet_data_dir], help="directory which may contain plot header information") - parser.add_option("-Q", "--quiet", help="Suppress normal messages", dest="LOGLEVEL", + parser.add_option("-q", "--quiet", help="Suppress normal messages", dest="LOGLEVEL", action="store_const", default=logging.INFO, const=logging.WARNING) - parser.add_option("-V", "--verbose", help="Add extra debug messages", dest="LOGLEVEL", + parser.add_option("-v", "--verbose", help="Add extra debug messages", dest="LOGLEVEL", action="store_const", default=logging.INFO, const=logging.DEBUG) opts, args = parser.parse_args() Modified: trunk/bin/make-plots ============================================================================== --- trunk/bin/make-plots Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/make-plots Sat Jun 19 15:19:03 2010 (r2489) @@ -1785,9 +1785,9 @@ parser.add_option("-c", "--config", dest="CONFIGFILES", action="append", default=None, help="Plot config file to be used. Overrides internal config blocks.") verbgroup = OptionGroup(parser, "Verbosity control") - verbgroup.add_option("-V", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", + verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", default=logging.INFO, help="print debug (very verbose) messages") - verbgroup.add_option("-Q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", + verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", default=logging.INFO, help="be very quiet") parser.add_option_group(verbgroup) Modified: trunk/bin/rivet ============================================================================== --- trunk/bin/rivet Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/rivet Sat Jun 19 15:19:03 2010 (r2489) @@ -95,8 +95,12 @@ help="add an analysis to the processing list.") parser.add_option("-A", "--all-analyses", dest="ALL_ANALYSES", action="store_true", default=False, help="add all analyses to the processing list.") +parser.add_option("--analysis-path", dest="ANALYSIS_PATH", metavar="PATH", default=None, + help="specify the analysis search path (cf. $RIVET_ANALYSIS_PATH).") +parser.add_option("--analysis-path-append", dest="ANALYSIS_PATH_APPEND", metavar="PATH", default=None, + help="append to the analysis search path (cf. $RIVET_ANALYSIS_PATH).") parser.add_option("--list-analyses", dest="LIST_ANALYSES", action="store_true", - default=False, help="show the list of available analyses' names. With -V, it shows the descriptions, too") + default=False, help="show the list of available analyses' names. With -v, it shows the descriptions, too") parser.add_option("--list-used-analyses", action="store_true", dest="LIST_USED_ANALYSES", default=False, help="list the analyses used by this command (after subtraction of inappropriate ones)") parser.add_option("--show-analysis", dest="SHOW_ANALYSES", action="append", @@ -114,9 +118,9 @@ verbgroup = OptionGroup(parser, "Verbosity control") parser.add_option("-l", dest="NATIVE_LOG_STRS", action="append", default=[], help="set a log level in the Rivet library") -verbgroup.add_option("-V", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", +verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", default=logging.INFO, help="print debug (very verbose) messages") -verbgroup.add_option("-Q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", +verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", default=logging.INFO, help="be very quiet") parser.add_option_group(verbgroup) opts, args = parser.parse_args() @@ -237,6 +241,18 @@ pass +## Override/modify analysis search path +if opts.ANALYSIS_PATH: + os.environ["RIVET_ANALYSIS_PATH"] = opts.ANALYSIS_PATH +if opts.ANALYSIS_PATH_APPEND: + anapath = os.environ.get("RIVET_ANALYSIS_PATH", "") + if anapath: + anapath += ":" + anapath += opts.ANALYSIS_PATH_APPEND + os.environ["RIVET_ANALYSIS_PATH"] = anapath +logging.debug("RIVET_ANALYSIS_PATH = " + os.environ.get("RIVET_ANALYSIS_PATH", "")) + + ## List of analyses all_analyses = rivet.AnalysisLoader.analysisNames() if opts.LIST_ANALYSES: Modified: trunk/bin/rivet-chopbins ============================================================================== --- trunk/bin/rivet-chopbins Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/rivet-chopbins Sat Jun 19 15:19:03 2010 (r2489) @@ -68,10 +68,10 @@ help="output directory (default: %default)") verbgroup = OptionGroup(parser, "Verbosity control") - verbgroup.add_option("-V", "--verbose", action="store_const", + verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", help="print debug (very verbose) messages") - verbgroup.add_option("-Q", "--quiet", action="store_const", + verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", help="be very quiet") parser.set_defaults(bins=[], Modified: trunk/bin/rivet-mergeruns ============================================================================== --- trunk/bin/rivet-mergeruns Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/rivet-mergeruns Sat Jun 19 15:19:03 2010 (r2489) @@ -321,9 +321,9 @@ parser.add_option("-o", "--out", dest="OUTFILE", default="-") parser.add_option("--append", dest="APPEND_OUTPUT", action="store_true", default=False) verbgroup = OptionGroup(parser, "Verbosity control") - verbgroup.add_option("-V", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", + verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", default=logging.INFO, help="print debug (very verbose) messages") - verbgroup.add_option("-Q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", + verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", default=logging.INFO, help="be very quiet") parser.add_option_group(verbgroup) (opts, args) = parser.parse_args() Modified: trunk/bin/rivet-mkanalysis ============================================================================== --- trunk/bin/rivet-mkanalysis Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/rivet-mkanalysis Sat Jun 19 15:19:03 2010 (r2489) @@ -15,9 +15,9 @@ parser.add_option("--srcroot", metavar="DIR", dest="SRCROOT", default=None, help="install the templates into the Rivet source tree (rooted " + "at directory DIR) rather than just creating all in the current dir") -parser.add_option("-Q", "--quiet", dest="LOGLEVEL", default=logging.INFO, +parser.add_option("-q", "--quiet", dest="LOGLEVEL", default=logging.INFO, action="store_const", const=logging.WARNING, help="only write out warning and error messages") -parser.add_option("-V", "--verbose", dest="LOGLEVEL", default=logging.INFO, +parser.add_option("-v", "--verbose", dest="LOGLEVEL", default=logging.INFO, action="store_const", const=logging.DEBUG, help="provide extra debugging messages") opts, args = parser.parse_args() try: Modified: trunk/bin/rivet-rescale ============================================================================== --- trunk/bin/rivet-rescale Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/rivet-rescale Sat Jun 19 15:19:03 2010 (r2489) @@ -199,10 +199,10 @@ parser.add_option("-f", dest="AIDA", action="store_false", help="Produce FLAT output rather than AIDA") verbgroup = OptionGroup(parser, "Verbosity control") - verbgroup.add_option("-V", "--verbose", action="store_const", + verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", help="print debug (very verbose) messages") - verbgroup.add_option("-Q", "--quiet", action="store_const", + verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", help="be very quiet") parser.set_defaults(bins=[], Modified: trunk/bin/rivetgrid ============================================================================== --- trunk/bin/rivetgrid Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/bin/rivetgrid Sat Jun 19 15:19:03 2010 (r2489) @@ -38,9 +38,9 @@ parser.add_option("--dry-run", dest="DRY_RUN", action="store_true", default=False, help="do everything but actually submit the job") verbgroup = OptionGroup(parser, "Verbosity control") -verbgroup.add_option("-V", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", +verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL", default=logging.INFO, help="print debug (very verbose) messages") -verbgroup.add_option("-Q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", +verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL", default=logging.INFO, help="be very quiet") parser.add_option_group(verbgroup) (opts, args) = parser.parse_args() Modified: trunk/data/rivet-completion ============================================================================== --- trunk/data/rivet-completion Sat Jun 19 12:47:00 2010 (r2488) +++ trunk/data/rivet-completion Sat Jun 19 15:19:03 2010 (r2489) @@ -10,8 +10,9 @@ opts="--help --verbose --quiet --version --nevts --cross-section" opts="$opts --analysis --runname --list-analyses --show-analysis" + opts="$opts --analysis-path --analysis-path-append" opts="$opts --histo-file --histo-interval" - opts="$opts -a -A -n -h -x -H -l -V -Q" + opts="$opts -a -A -n -h -x -H -l -v -q" if [[ ${cur} == -* ]] ; then #if test -x "$(which rivet)"; then # anas=$(rivet --list-options)
More information about the Rivet-svn mailing list |