NNPDF / reportengine

A framework for declarative data analysis
https://data.nnpdf.science/validphys-docs/guide.html
GNU General Public License v2.0
1 stars 2 forks source link

Files in the same folder can take precedence over validphys scripts' files #55

Open scarlehoff opened 1 year ago

scarlehoff commented 1 year ago

If one runs a validphys script (for instance vp-comparefits) in a folder where there is already a report.md file. This report.md will take precedence over the one define in the script.

Not sure whether this is something that should be fixed in reportengine or in validphys.

Zaharid commented 1 year ago

The code would be here

https://github.com/NNPDF/reportengine/blob/aad662b5b9e371d5d1b44aeadebaf0702ebe6a05/src/reportengine/report.py#L333

but I am not sure this should be changed. For one it works so that it is easy to reproduce something from the output folder. Better ideas welcome.

scarlehoff commented 1 year ago

I think in the case of a script the templates defined in the script should take precedence. There's no reason I should know the names used in the script to avoid them in the folder which I'm running from.

I would've expect a crash or at least a warning if there's an ambiguity, no silently getting the wrong result. In any case I'll transfer the issue to the RE repository then.

Zaharid commented 1 year ago

Comparefits is a bit of a special case in that the filename is harcoded in the script. In the flow it was designed for, the filename is supposed to be relative to the current path. If you were writing a vp runcard and the template was randomly pulled from elsewhere that would be confusing. So I guess some other mechanism would be needed.