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
DM-34117: Update stats to improve readability #37
Conversation
pipelines/coaddQAPlots_test.yaml
Outdated
@@ -0,0 +1,46 @@ | |||
description: Make coadd plots for QA |
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.
Did you mean to push this file?
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.
I did not, sorry, I lost track of my test pipeline.
lowStats[sourceType] = lowStatsStr | ||
|
||
if np.sum(highSn) > 0: | ||
highMags[sourceType] = f"{np.nanmax(catPlot.loc[highSn, magCol]):.2f}" | ||
sortedMags = np.sort(catPlot.loc[highSn, magCol]) | ||
x = int((len(sortedMags)/100)*10) |
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.
Did you want to do an integer division with //
here? Otherwise, this is going to be identical to int(len(sortedMags)/10)
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.
I left it like this to make it more obvious that I was going for 10%, I can tidy it up if you would prefer.
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.
To me, it looked like you were trying something else here. It might be cleaner to just have this line as int(len(sortedMags)/10)
or int(0.1*len(sortedMags))
and have a comment that it's 10%, if you prefer to make it more evident.
if len(xs) < 2: | ||
medLine, = ax.plot(xs, np.nanmedian(ys), color, | ||
label="Median: {:0.2f}".format(np.nanmedian(ys)), lw=0.8) | ||
label="Median: {:0.3g}".format(np.nanmedian(ys)), lw=0.8) |
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.
label="Median: {:0.3g}".format(np.nanmedian(ys)), lw=0.8) | |
label=f"Median: {np.nanmedian(ys):0.3g}", lw=0.8) |
87aec6a
to
f1554a2
Compare
Rebasing has picked up old commits, it looks like |
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.
Many commits are doing much more than what the commit message says - for e.g., "Fix bugs so that the pipelines runs on dc2" in addition to fixing bugs, does string formatting and converting to scientific notation when there's another commit that does the conversion in other places. Some commits are also negative changes from previous commits - for e.g., addition and removal of print("END OF SOURCE TYPE LIST")
. It might be easier to get the branch to a working state, squash all commits and split them into smaller pieces.
lowStats[sourceType] = lowStatsStr | ||
|
||
if np.sum(highSn) > 0: | ||
highMags[sourceType] = f"{np.nanmax(catPlot.loc[highSn, magCol]):.2f}" | ||
sortedMags = np.sort(catPlot.loc[highSn, magCol]) | ||
x = int((len(sortedMags)/100)*10) |
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.
To me, it looked like you were trying something else here. It might be cleaner to just have this line as int(len(sortedMags)/10)
or int(0.1*len(sortedMags))
and have a comment that it's 10%, if you prefer to make it more evident.
Could you use {.3e} instead of {.3g}. The latter seems to switch to scientific notation only in some cases. For example, In [1]: a = 0.000123
In [2]: f"a = {a:.3g}"
Out[2]: 'a = 0.000123'
In [3]: f"a = {a:.3e}"
Out[3]: 'a = 1.230e-04'
In [4]: a = 0.0000123
In [5]: f"a = {a:.3g}"
Out[5]: 'a = 1.23e-05'
In [6]: f"a = {a:.3e}"
Out[6]: 'a = 1.230e-05' The distinction between the two formatting becomes significant if In [7]: a = 456.789
In [8]: f"a = {a:.3g}"
Out[8]: 'a = 457'
In [9]: f"a = {a:.3e}"
Out[9]: 'a = 4.568e+02' |
We actually get integers and decimals with not that many 0s quite often and I find the scientific notation for them very awkward. |
Fair enough. This should be good to merge after a rebase. |
No description provided.