print("Need to rerun {} / {} models".format(len(rerun), len(args.logs)))
print("Saving the results in rerun_output.sh")
with open("rerun_output.sh", "w") as fout:
for command in rerun:
fout.write(command + "\n")
if __name__ == "__main__":
main()
After Change
ret = process_single(log, args.verbose)
if ret:
rerun += [ret]
rerun = sorted(rerun, key=lambda x: x["last_val"], reverse=True)
print("Need to rerun {} / {} models".format(len(rerun), len(args.logs)))
print("Saving the results in rerun_output.json")
with open("rerun_output.json", "w") as fout:
json.dump(rerun, fout)
if __name__ == "__main__":
main()