-
Notifications
You must be signed in to change notification settings - Fork 26
Change procedure for saving plots for monitoring #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just a few comments, mostly about style. In general, take care of alignment and check new np.array types as np.ndarray
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.