Change procedure for saving plots for monitoring #43
Change procedure for saving plots for monitoring #43ausonandres wants to merge 15 commits intonext-exp:masterfrom
Conversation
krcal/core/io_functions.py
Outdated
| plt.xticks( rotation=25 ) | ||
| plt.text(0.03,0.9, | ||
| 'Mean= {0} \n Std= {1}'.format(np.round(mean,4), np.round(std,4)), | ||
| fontsize=10, transform=ax.transAxes, | ||
| bbox={'facecolor': 'white', 'alpha': 1, 'pad': 5}) |
There was a problem hiding this comment.
Spacing also inconsistent. Not sure, but maybe @gonzaponte can shed light on the style we follow, but I guess that:
when_in_line(we=don't, add=spaces)
when_not_in_line(we = do
add = spaces)
There was a problem hiding this comment.
Indeed. But in this case they are combined, so I would give preference to = over =. Maybe even splitting into 1 keyword argument per line.
May I also suggest the use of f-strings and string-formatting syntax?
f'Mean= {mean:.4f} \n Std= {std:.4f}'
There was a problem hiding this comment.
Ok, thanks. Regarding your second suggestion we have a question: in the event that you have a variable called, for example: name='Run{0}.pdf', if you want to substitute {0} for a certain value, could it be possible to do it in your way? or only: name.format(runnumber) using format?
There was a problem hiding this comment.
In the case it is already stored in a variable you need to do .format. f-strings are evaluated immediately, so you either do
name = f"Run{run}.pdf"orname = "Run{0}.pdf"; name.format(run)
There was a problem hiding this comment.
Ok! thank you.
Following issue #41, some functions have been implemented to add plots of the evolution of almost all parameters inside maps.t_evol table. Besides that, all plots are saved as pdf images, instead of being stored as pd.DataFrame in a unique file.
Tests will be added soon.