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

Namespace production rules give wrong results for implicit keys #16

Open Zaharid opened 5 years ago

Zaharid commented 5 years ago

The following validphys runcard

theory:
    from_: fit

theoryid:
    from_: theory

use_cuts: "fromfit"

pdf:
    from_: fit

experiments:
    from_: fit

dataspecs:
  - fit: NNPDF31_nlo_as_0118_1000

  - fit: NNPDF31_nnlo_as_0118_1000

actions_:
    - matched_datasets_from_dataspecs::dataspecs plot_fancy_dataspecs

gives the wrong results in that the datasets incorrectly resolve to the first (NLO) value. It works fine if

experiments:
    from_: fit

is inside each dataspec. This has to do with the fact that even though we specify write=False in the validphys production rules, the parameter is not propagated to resolve_signature_params. This change:

diff --git a/src/reportengine/configparser.py b/src/reportengine/configparser.py
index 26138aa..3d79657 100644
--- a/src/reportengine/configparser.py
+++ b/src/reportengine/configparser.py
@@ -294,7 +294,7 @@ class Config(metaclass=ConfigMetaClass):
                                                ns,
                                                input_params= input_params,
                                                max_index=max_index,
-                                               parents=parents)
+                                               parents=parents, write=False)
             except KeyError:
                 if param.default is not sig.empty:
                     pval = param.default

appears to fix the problem, but then some other test fails. Have to check if correctly propagating the argument works. Or rewrite the whole thing in a way that is not crazy.