Add more context to errors raised in the convergence helper
In convergence_helper.py
(invoked when plotting experiment results), there are several occasions where an error is printed to stdout
:
if len(convergence['avg']) < 2:
print('error insufficient number of measurements for {}'.format(entry))
sys.exit(1)
I think it would be helpful to:
- Redirect this error to
stderr
, and - Raise an exception so there is context information available.
Specifically, I got the following lines in my logs and I found it a bit hard to track where the error is. Raising an exception could make this easier.
+ python3 plot/convergence.py
Namespace(results=None, save_figure=None, yaxis='validation-accuracy', ymin=0.0, ymax=None, labels=[], add_min_max=False, add_std=False, class_index=None, show_std=False, legend='best', merge_min_max=[], no_legend=False, font_size=16, markers=[], linestyles=[], linewidth=1.5)
error insufficient number of measurements for /var/scratch/spandey/jenkins/workspace/pers/accountable_dfl/dfl_basic/output/2022-03-11-11:59:51-CET-fs3.das6.tudelft.nl