I am writing a program that runs for a long time. I want to run this program many times so that I can see the dependence of my results on the tweaking of parameters. So, suppose a situation similar to the following:
parameter=1
"Big code that takes a long time"
print(output, "output that depends on t")
plt.plot(x,y)
Now change the parameter to 2 and re-run again. I want to be able to pull the results of the previous one so that I can compare them.
So I want to sort of store them somehow so that the next time I need to look at the results I just have to execute a few lines and the stored results come up really quickly.
You can store all the information such as the inputs, params, and outputs in a dictionary. You can then use the dict to do further plotting and analysis.
Here I add a minimal reproducible example. You can use this as a reference for your needs. The below code produces this plot as an output.