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

Andy Buckley andy.buckley at ed.ac.uk
Mon Jan 31 14:54:34 GMT 2011


Hi Frank,

That was on purpose, since all of our other variables are taken as
canonical search path definitions rather than extra search locations.
You'd think this would be simple, but it took us several wrong guess
attempts to make path handling that really worked without weird
side-effects... not being able to explicitly override the defaults is a
problem.

So for consistency and avoiding side-effects I would like to keep this
behaviour as it is now (and implemented in RivetPaths.cc rather than
slightly differently in each script!)

However, we also want your scripts to work of course -- I suspect that
your Sherpa tests are the ~single place that the RIVET_PLOT_PATH feature
is being explicitly used, so now is the time to change. Can you make
your scripts work with the new system? With the head version you should
be able to do most path setting just using RIVET_ANALYSIS_PATH, with the
other variables being intended for fine-grained control of less typical
setups. The analysis path list (as determined by RivetPaths) will be
used as the default for all path types without an explicitly-set variable.

I think it would also be nice to avoid having to do things like
RIVET_ANALYSIS_PATH=/my/personal/rivet/path:`rivet-config --libdir`, but
I've not yet convinced myself that it's important enough to warrant a
RIVET_ANALYSIS_PATH_APPEND variable or similar... any nicer ideas for an
improvement there?

Andy


On 25/01/11 20:03, Frank Siegert wrote:
> 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;
>> +  }
>> +
>> +
>>   }
> _______________________________________________
> Rivet mailing list
> Rivet at projects.hepforge.org
> http://www.hepforge.org/lists/listinfo/rivet
> 


-- 
Dr Andy Buckley
SUPA Advanced Research Fellow
Particle Physics Experiment Group, University of Edinburgh

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the Rivet mailing list