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

Using key: {from_: <production rule>} overwrites value for key in collect #38

Open wilsonmr opened 3 years ago

wilsonmr commented 3 years ago

This is linked to NNPDF/nnpdf#1008 but I have found another example:

fit: 031120-mw-001
pdf: {from_: fitpdf} # take key from production rule

pdfs:
 - NNPDF31_nnlo_as_0118

actions_:
 - report(main=True)

template_text: |
 {@with pdfs@}
 {@pdf@}
 {@endwith@}

outputs 031120-mw-001. However:

fit: 031120-mw-001
pdf: {from_: fit} # take key from a resource with `as_input` method

pdfs:
 - NNPDF31_nnlo_as_0118

actions_:
 - report(main=True)

template_text: |
 {@with pdfs@}
 {@pdf@}
 {@endwith@}

does not, it outputs NNPDF31_nnlo_as_0118. I personally think the second behaviour is correct but maybe I have a bad opinion!

If we want to change this then I guess there is something special with how {from_: <production rule>} is interacting with collect? I guess it doesn't get resolved and somehow takes precedence when unresolved whereas if {from_: } gets resolved sooner?

Zaharid commented 3 years ago

I have no idea why or how the first thing is happening, but it is surely wrong...