-
Notifications
You must be signed in to change notification settings - Fork 101
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
Compare parfiles #1340
Compare parfiles #1340
Conversation
dlakaplan
commented
Jul 13, 2022
- Command-line utility to compare par files
- Use colors for output
- Bugfixes to reduce crashes
Usage:
|
@scottransom : I am trying to colorize the output. But I want to just adjust the background color while leaving the foreground static. is there a way to do that? |
Hmmm. Good question. I think to do that you would somehow have to query your terminal environment to know what the current foreground and background colors are. I certainly don't know of a way to do that. |
Would it be possible to (optionally?) output a Markdown table, where markdown highlights ( (ETA: And notebooks, of course, can natively display Markdown output with a very little persuasion.) |
I was part-way to turning it into more table-like output anyway, so if I finished that adding markdown would be trivial. I did search on how to find the current foreground/background colors, but couldn't find a good answer. This is mostly relevant since e.g., I have white text on black as the default, so just fg=black isn't right. |
Codecov Report
@@ Coverage Diff @@
## master #1340 +/- ##
==========================================
- Coverage 61.31% 61.25% -0.07%
==========================================
Files 89 90 +1
Lines 20218 20349 +131
Branches 3619 3646 +27
==========================================
+ Hits 12397 12465 +68
- Misses 7046 7097 +51
- Partials 775 787 +12
Continue to review full report at Codecov.
|
@almcewen0 : since you worked on this some, maybe you can take a look. Especially if you use this in notebooks see how the markdown output looks |
i think it looks great on the command line! it doesn't run in a jupyter notebook, but that might be better suited for the model.compare() function. |
The command-line version wraps |
@swiggumj : would this markdown output be using in timing analysis? |
This looks great. Yeah, I think so!... I'd have to check, but I think it also might help clean up some of the code where things get compiled into per-pulsar summary files. |
Indeed. This could (should!) be used directly in the timing_analysis notebooks so you can show the comparison. For the summaries, right now the table is shown as preformatted, but this would allow us to produce much nicer-looking tables as a drop-in replacement. |
Were you thinking that the |
That looks sweet. But looking at the readthedocs example, what is up with F1?! |
No idea - it's also in the cells above when the Powell fit results are shown. And I think that has been around for a while: |
@scottransom : actually wait a second. I want to update the docs slightly. |
Oops! I saw that too late! |
OK, I guess I was too late. I will just edit that directly then (just to note that without |
I think you can just merge the doc changes directly in since they don't affect our CI tests |