[Rivet] [Rivet-svn] r2876 - in trunk: . bin include/Rivet/Tools src/Analyses src/Core src/Tools

Frank Siegert frank.siegert at cern.ch
Tue Jan 25 20:03:34 GMT 2011


Hi Andy,

thanks for many of these improvements, but I have one complaint: Before 
this commit, the environment variable RIVET_PLOT_PATH would add to the 
search path for .plot files. Now it completely overwrites it. (see code 
snippets below)
Is that on purpose or do we want to stay backward compatible? (e.g. the 
Sherpa benchmark plotting scripts break with that change, that's how I 
noticed)

Cheers,
Frank

On 12/01/11 23:55, blackhole at projects.hepforge.org wrote:
> Author: buckley
> Date: Wed Jan 12 22:55:30 2011
> New Revision: 2876

[...]

> Modified: trunk/bin/compare-histos
> ==============================================================================
> --- trunk/bin/compare-histos	Tue Jan 11 14:59:39 2011	(r2875)
> +++ trunk/bin/compare-histos	Wed Jan 12 22:55:30 2011	(r2876)
> @@ -143,11 +143,8 @@
>           opts.SHOW_IF_REF_ONLY = True
>
>
> -    ## Add RIVET_PLOT_PATH and ref data dirs to PLOTINFO path
> -    if os.environ.has_key("RIVET_PLOT_PATH"):
> -        opts.PLOTINFODIR += [os.path.abspath(i) for i in os.environ["RIVET_PLOT_PATH"].split(":") if i]
> -    opts.PLOTINFODIR += rivet_data_dirs
> -    #print opts.PLOTINFODIR
> +    ## Add standard locations and the input files' dirs to the PLOTINFO search paths
> +    opts.PLOTINFODIR += rivet.getAnalysisPlotPaths()
>       for a in args:
>           adir = os.path.abspath(os.path.split(a)[0])
>           if not adir in opts.PLOTINFODIR:
>

[...]

> Modified: trunk/src/Tools/RivetPaths.cc
> ==============================================================================
> --- trunk/src/Tools/RivetPaths.cc	Tue Jan 11 14:59:39 2011	(r2875)
> +++ trunk/src/Tools/RivetPaths.cc	Wed Jan 12 22:55:30 2011	(r2876)
> @@ -92,4 +92,21 @@
>     }
>
>
> +  const vector<string>  getAnalysisPlotPaths() {
> +    vector<string>  dirs;
> +    char* env = 0;
> +    env = getenv("RIVET_PLOT_PATH");
> +    if (env) {
> +      // Use the Rivet analysis path variable if set...
> +      dirs += pathsplit(env);
> +    } else {
> +      // ... otherwise fall back to the Rivet data install path
> +      dirs += getRivetDataPath();
> +      // ... and also add any analysis plugin search dirs for convenience
> +      dirs += getAnalysisLibPaths();
> +    }
> +    return dirs;
> +  }
> +
> +
>   }


More information about the Rivet mailing list