postfit.py `check_replica_files` not robust/error message not helpful
Created by: wilsonmr
Hi there,
I ran postfit and it said there was a critical error (posted below). The problem was that a fit ran at CERN has outputted a full set of replica files so passes check_replica_files, however the .fitinfo file for one of these replicas is completely empty.
Accounting for similar issues for this isn't trivial however I scanned the postfit log and did debug mode and it didn't tell me the problematic replica folder which didn't make tracking down the problem as easy as it could be - if possible it would be nice if postfit could indicate where it got stuck, i.e on a particular replica file
INFO]: 146 total replicas found
[INFO]: 105 valid replicas found
[CRITICAL]: Bug in postfit ocurred. Please report it.
Traceback (most recent call last):
File "/scratch/miniconda/envs/vp2dev/bin/postfit", line 11, in <module>
load_entry_point('validphys', 'console_scripts', 'postfit')()
File "/home/s1758208/nnpdfgit/nnpdf/validphys2/src/validphys/scripts/postfit.py", line 187, in main
postfit(args.result_path, args.nrep)
File "/home/s1758208/nnpdfgit/nnpdf/validphys2/src/validphys/scripts/postfit.py", line 125, in postfit
passing_paths = filter_replicas(postfit_path, nnfit_path, fitname)
File "/home/s1758208/nnpdfgit/nnpdf/validphys2/src/validphys/scripts/postfit.py", line 83, in filter_replicas
fitinfo = [fitdata.load_fitinfo(pathlib.Path(path), fitname) for path in valid_paths]
File "/home/s1758208/nnpdfgit/nnpdf/validphys2/src/validphys/scripts/postfit.py", line 83, in <listcomp>
fitinfo = [fitdata.load_fitinfo(pathlib.Path(path), fitname) for path in valid_paths]
File "/home/s1758208/nnpdfgit/nnpdf/validphys2/src/validphys/fitdata.py", line 84, in load_fitinfo
n_iterations = int( fitinfo_line[0])