File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -568,17 +568,24 @@ def check_eko_exists(theoryid):
568568
569569
570570@make_argcheck
571- def fktable_hasher (data ):
571+ def fktable_hasher (data , output_path ):
572572 """Writes a hash of the fk-table to a log file.
573- This hash can be used to ensure whether two
574- (supposedely identical) fk-tables of the same
573+ This hash can be used to ensure whether two
574+ (supposedly identical) fk-tables of the same
575575 theory and dataset are numerically identical.
576576 """
577- keys = {}
578- for dataset in data .datasets :
579- fkspecs = dataset .fkspecs
580- for fk in fkspecs :
581- fkpath = fk .fkpath [0 ]
582- fkhash = hashlib .md5 (fkpath .read_bytes ()).hexdigest ()
583- # have to figure out how to write a file to the fitname dir where the other md5 also lives
584- log .info ("FK-table hash written to md5fk" )
577+ md5fk_path = output_path / "md5fk"
578+ with open (md5fk_path , "w" ) as f :
579+ for dataset in data .datasets :
580+ fkspecs = dataset .fkspecs
581+ for fk in fkspecs :
582+ for fkpaths , table_names in zip (
583+ fk .fkpath ,
584+ fk .metadata .FK_tables ,
585+ ):
586+ for fkpath , table_name in zip (fkpaths , table_names ):
587+ fkhash = hashlib .md5 (
588+ fkpath .read_bytes ()
589+ ).hexdigest ()
590+ f .write (f"{ table_name } { fkhash } \n " )
591+ log .info (f"FK-table hash written to { md5fk_path } " )
Original file line number Diff line number Diff line change 55# ~/.config/NNPDF/nnprofile.yaml
66# To change the configuration of the NNPDF code framework
77
8- nnpdf_share : ~/.local/share/NNPDF/theories
8+ nnpdf_share : ~/.local/share/NNPDF
99
1010results_path : results
1111ekos_path : ekos
You can’t perform that action at this time.
0 commit comments