NNPDF / pineappl

PineAPPL is not an extension of APPLgrid
https://nnpdf.github.io/pineappl/
GNU General Public License v3.0
12 stars 3 forks source link

Calling `convolute` without a PDF set triggers a panic #100

Closed felixhekhorn closed 2 years ago

felixhekhorn commented 2 years ago
$ pineappl --version
pineappl v0.5.0-beta.5-20-g725e410
$ pineappl convolute data/grids/200-NMC_NC_EM_P_F2.pineappl.lz4 
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', pineappl_cli/src/convolute.rs:50:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
cschwan commented 2 years ago

The reason is that you've forgot to specify the PDF set, but it should tell you that, of course. For some reason the CLI ignores min_values = 1 in the following line:

https://github.com/N3PDF/pineappl/blob/725e4109c2b9f90cc883abd251c190409fe9f22c/pineappl_cli/src/convolute.rs#L16-L17

felixhekhorn commented 2 years ago

I know :upside_down_face: but stupid users like me may forget that on the first shot ;-)

cschwan commented 2 years ago

@felixhekhorn thanks for the report, that was indeed a bug not only in convolute but also in merge and plot. Commit 95b7341ecf607e23234d60fde6c73fe99596827a should fix the problem. Can you please check if it works for you? In that case please close this Issue.

felixhekhorn commented 2 years ago

Seems to work

$ pineappl convolute data/grids/200-NMC_NC_EM_P_F2.pineappl.lz4 
error: The following required arguments were not provided:
    <PDFSETS>...

USAGE:
    pineappl convolute [OPTIONS] <INPUT> <PDFSETS>...

For more information try --help