Skip to content

Commit 1ce259d

Browse files
committed
download theoryid in setupfit, even in faketheoryid exists
1 parent 365e3f6 commit 1ce259d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

n3fit/runcards/examples/Basic_runcard_closure_test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,6 @@ maxcores: 8
8383
closuretest:
8484
filterseed: 3345348918 # Random seed to be used in filtering data partitions
8585
fakedata: true # true = to use FAKEPDF to generate pseudo-data
86-
fakepdf: NNPDF40_nnlo_as_01180 # Theory input for pseudo-data
86+
fakepdf: NNPDF40_nnlo_as_01180 # PDF input for pseudo-data
8787
fakenoise: true # true = to add random fluctuations to pseudo-data
88+
faketheoryid: 708 # theory input for pseudo-data

n3fit/src/n3fit/scripts/vp_setupfit.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@
3737
from reportengine import colors
3838
from validphys.app import App
3939
from validphys.config import Config, ConfigError, Environment, EnvironmentError_
40+
from validphys.loader import FallbackLoader
4041
from validphys.utils import yaml_safe
4142

43+
l = FallbackLoader()
44+
4245
SETUPFIT_FIXED_CONFIG = dict(
4346
actions_=[
4447
'datacuts check_t0pdfset',
@@ -146,7 +149,12 @@ def from_yaml(cls, o, *args, **kwargs):
146149
# Use faketheoryid to create the L0 data to be stored into the filter folder
147150
# (L1 data is stored if fakedata is True)
148151
if 'faketheoryid' in closuredict:
149-
file_content['theory']['theoryid'] = closuredict['faketheoryid']
152+
# make sure theory key exists in SETUPFIT_FIXED_CONFIG
153+
SETUPFIT_FIXED_CONFIG.setdefault('theory', {})
154+
# overwrite theoryid with the faketheoryid
155+
SETUPFIT_FIXED_CONFIG['theory']['theoryid'] = closuredict['faketheoryid']
156+
# download theoryid since it will be used in the fit
157+
l.check_theoryID(file_content['theory']['theoryid'])
150158
filter_action = 'datacuts::closuretest::theory::fitting filter'
151159
check_n3fit_action = 'datacuts::theory::closuretest::fitting n3fit_checks_action'
152160
else:

0 commit comments

Comments
 (0)