Skip to content

Commit f4f8ec8

Browse files
committed
add jcm suggestion
1 parent 77817c7 commit f4f8ec8

3 files changed

Lines changed: 30 additions & 21 deletions

File tree

n3fit/src/n3fit/checks.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,11 @@ def check_eko_exists(theoryid):
564564
_ = FallbackLoader().check_eko(theoryid.id)
565565
except FileNotFoundError:
566566
log.error(f"No eko found for {theoryid}")
567+
568+
569+
@make_argcheck
570+
def fktable_hasher(data):
571+
for dataset in data.datasets:
572+
fkspecs = dataset.fkspecs
573+
for fk in fkspecs:
574+
print(fk.fkpath)

n3fit/src/n3fit/n3fit_checks_provider.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99

1010
@n3fit.checks.check_consistent_basis
11+
@n3fit.checks.fktable_hasher
1112
@n3fit.checks.wrapper_check_NN
1213
@n3fit.checks.wrapper_hyperopt
1314
@n3fit.checks.check_deprecated_options

n3fit/src/n3fit/scripts/vp_setupfit.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -204,29 +204,29 @@ def from_yaml(cls, o, *args, **kwargs):
204204
)
205205

206206
# Save a hash of the FK-Table metadata
207-
l = Loader()
208-
209-
TheoryIDSpec = l.check_theoryID(theoryid)
210-
keys = {}
207+
#keys = {}
211208

212-
for ds in file_content["dataset_inputs"]:
213-
setname = ds["dataset"]
214-
cdspec = loader.check_commondata(setname)
209+
#l = Loader()
210+
#TheoryIDSpec = l.check_theoryID(theoryid)
211+
#
212+
#
213+
#for ds in file_content["dataset_inputs"]:
214+
# setname = ds["dataset"]
215+
#
216+
# cdspec = loader.check_commondata(setname)
217+
# import pdb; pdb.set_trace()
218+
# fk_tablename = str(cdspec.metadata.theory.FK_tables[0][0])
219+
# fk_tablepath = TheoryIDSpec.path + f"/{fk_tablename}.pineappl.lz4"
215220

216-
fk_tablename = str(cdspec.metadata.theory.FK_tables[0][0])
221+
# # fk = fk_table.FkTable.read(str(fk_tablepath))
217222

218-
fk_tablepath = TheoryIDSpec.path + f"/{fk_tablename}.pineappl.lz4")
223+
# # Should we dump the fk.metadata as opposed to fk_tablepath.read_bytes()?
224+
# fkhash = hashlib.md5(fk_tablepath.read_bytes()).hexdigest()
225+
# keys[fk_tablename] = (
226+
# f"{theoryid}_{fk_tablename}_{fkhash}"
227+
# )
219228

220-
# fk = fk_table.FkTable.read(str(fk_tablepath))
221-
# Should we dump the fk.metadata as opposed to fk_tablepath.read_bytes()?
222-
fkhash = hashlib.md5(fk_tablepath.read_bytes()).hexdigest()
223-
224-
225-
keys[fk_tablename] = (
226-
f"{theoryid}_{fk_tablename}_{fkhash}"
227-
)
228-
229-
file_content["_fk_hashes"] = keys
229+
#file_content["_fk_hashes"] = keys
230230

231231

232232
# Check fiatlux configuration
@@ -314,8 +314,8 @@ def run(self):
314314
self.environment.save_md5()
315315

316316
# and save the fk hashes
317-
fk_hashes = self.config_class["_fk_hashes"]
318-
self.environment.save_fk_md5(fk_hashes)
317+
# fk_hashes = self.config_class["_fk_hashes"]
318+
# self.environment.save_fk_md5(fk_hashes)
319319
except SetupFitError as e:
320320
log.error(f"Error in setup-fit:\n{e}")
321321
sys.exit(1)

0 commit comments

Comments
 (0)