If the number of standard and output logs are different, the parsing of the log directory fails. Fix is to split filename here based on a different string:
op_fn = [f.split("_carbontracker")[0] for f in output_logs]
std_fn = [f.split("_carbontracker")[0] for f in std_logs]
If the number of standard and output logs are different, the parsing of the log directory fails. Fix is to split filename here based on a different string: