Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collect resolves explicit_node lazily #1493

Open
siranipour opened this issue Dec 23, 2021 · 6 comments
Open

collect resolves explicit_node lazily #1493

siranipour opened this issue Dec 23, 2021 · 6 comments
Assignees
Labels
bug Something isn't working validphys

Comments

@siranipour
Copy link
Contributor

This is probably more appropriate for reportengine, but the issue arises in validphys. Consider the following runcard:

dataspecs:
  - pdf: NNPDF31_nnlo_as_0118

theoryid: 200

use_cuts: "internal"

dataset_input: {dataset: NMC}

actions_:
  - plot_fancy_dataspecs

This errors complaining that covmat is not an array. Taking a look, it's an explicit_node instance. If we look at why, it's because plot_fancy_dataspecs takes as an argument dataspecs_results which is a collection of results over dataspecs:

dataspecs_results = collect("results", ("dataspecs",))

and since #1477 was merged, the covariance_matrix is dispatched as an explicit_node and this is the root of the bug. The explicit_node does not get resolved in time by reportengine and so the results objects in the collection don't have the covariance_matrix resolved by the time we hit this line:
results = [dataspecs_results[0][0], *[r[1] for r in dataspecs_results]]

@siranipour siranipour added bug Something isn't working validphys labels Dec 23, 2021
@siranipour
Copy link
Contributor Author

Although, I've just tried running this runcard using the 4.0.0 tag and the same thing happens. But even back then, the covariance matrix was an explicit_node. Has this always been an issue and I'm just using dataspecs incorrectly?

@Zaharid
Copy link
Contributor

Zaharid commented Dec 29, 2021

I am confused. Funnily enough this works

def patata(covariance_matrix):
    log.error(covariance_matrix)
    return None

x = collect("patata", ("dataspecs",))
dataspecs:
  - pdf: NNPDF31_nnlo_as_0118

theoryid: 200

use_cuts: "internal"

dataset_input: {dataset: NMC}

actions_:
  - x

Could you come up with a minimal example?

@Zaharid
Copy link
Contributor

Zaharid commented Dec 29, 2021

...not to mention that we have

def results(dataset: (DataSetSpec), pdf: PDF, covariance_matrix, sqrt_covmat):

and

sqrt_covmat(covariance_matrix)

and sqrt_covmat being fine inside results.

@Zaharid
Copy link
Contributor

Zaharid commented Dec 29, 2021

...If I had to bet, I'd say that it is some weirdness going on in config.py rather than a problem with reportengine, but not obvious to me so far either way.

@siranipour
Copy link
Contributor Author

The runcard I posted in the initial post fails for you too right?

@Zaharid
Copy link
Contributor

Zaharid commented Jan 7, 2022

Yes it does, but I couldn't readily understand why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validphys
Projects
None yet
Development

No branches or pull requests

2 participants