Skip to content

make a dataspecs positivity plot and update compfits report to use it#977

Merged
Zaharid merged 5 commits into
masterfrom
dataspecs-matched-positivity
Oct 21, 2020
Merged

make a dataspecs positivity plot and update compfits report to use it#977
Zaharid merged 5 commits into
masterfrom
dataspecs-matched-positivity

Conversation

@wilsonmr
Copy link
Copy Markdown
Contributor

closes #596

example:
https://vp.nnpdf.science/0vGt_IumTVKz5fLrR52jow==

is this what you had in mind @Zaharid ? I read your comments on the issue a few times and it still hurt my head but my interpretation was the matched_positivity_from_dataspecs was fine but we needed to collect over dataspecs properly inside of that for the plot, not use a with loop in report and take pdfs from outside of dataspecs

@wilsonmr wilsonmr requested a review from Zaharid October 16, 2020 15:55
Comment thread validphys2/src/validphys/checks.py Outdated
@wilsonmr
Copy link
Copy Markdown
Contributor Author

please check that you agree with the check

@Zaharid
Copy link
Copy Markdown
Contributor

Zaharid commented Oct 16, 2020

Note that we have

def _check_same_dataset_name(dataspecs_commondata):

Perhaps the two checks can be made to work into one?

@Zaharid
Copy link
Copy Markdown
Contributor

Zaharid commented Oct 21, 2020

Your example runcard fails now:

Traceback (most recent call last):
  File "/home/zah/anaconda3/bin/validphys", line 33, in <module>
    sys.exit(load_entry_point('validphys', 'console_scripts', 'validphys')())
  File "/home/zah/nngit/nnpdf/validphys2/src/validphys/scripts/main.py", line 10, in main
    vp.main()
  File "/home/zah/nngit/nnpdf/validphys2/src/validphys/app.py", line 153, in main
    a.main()
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/app.py", line 376, in main
    self.run()
  File "/home/zah/nngit/nnpdf/validphys2/src/validphys/app.py", line 149, in run
    super().run()
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/app.py", line 342, in run
    rb.resolve_fuzzytargets()
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 370, in resolve_fuzzytargets
    self.resolve_fuzzytarget(target)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 379, in resolve_fuzzytarget
    self.process_targetspec(fuzzytarget.name, spec, fuzzytarget.extraargs)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 388, in process_targetspec
    gen.send(None)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 445, in _process_requirement
    yield from self._make_node(name, nsspec, extraargs, parents)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 461, in _make_node
    yield from self._make_callspec(f, name, nsspec, extraargs, parents)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 524, in _make_callspec
    gen.send(cs)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 427, in _process_requirement
    yield from self._make_node((name, val.value), nsspec, extraargs, parents)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 457, in _make_node
    yield from self._make_collect_targets(f, name, nsspec, parents)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 666, in _make_collect_targets
    walk(colltargets.root, nsspec)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 664, in walk
    walk(newd, newspec)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 653, in walk
    gen.send(my_node)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 445, in _process_requirement
    yield from self._make_node(name, nsspec, extraargs, parents)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 461, in _make_node
    yield from self._make_callspec(f, name, nsspec, extraargs, parents)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/resourcebuilder.py", line 551, in _make_callspec
    environment=self.environment)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/checks.py", line 131, in check
    res = saturate(check_func, ns)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/utils.py", line 53, in saturate
    return func(**kwargs)
  File "/home/zah/nngit/nnpdf/validphys2/src/validphys/dataplots.py", line 934, in _check_same_posdataset_name
    _check_same_dataset_name([ds.commondataspec for ds in dataspecs_posdataset])
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/checks.py", line 114, in decorator
    add_check(f, check_func)
  File "/home/zah/anaconda3/lib/python3.7/site-packages/reportengine/checks.py", line 44, in add_check
    f.checks = [check]
AttributeError: 'list' object has no attribute 'checks'

@wilsonmr
Copy link
Copy Markdown
Contributor Author

ah I wrongly thought you could call checks as regular functions, my bad

@Zaharid
Copy link
Copy Markdown
Contributor

Zaharid commented Oct 21, 2020

They can't since call means apply as decorator for them. Anyhow, I checked that plot_fancy_dataspecs still works now.

@wilsonmr
Copy link
Copy Markdown
Contributor Author

Ah of course

@Zaharid Zaharid merged commit e5e6632 into master Oct 21, 2020
@Zaharid Zaharid deleted the dataspecs-matched-positivity branch October 21, 2020 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Positivity predictions mismatched and duplicated in the report

2 participants