Skip to content
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

Colored tables #74

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Colored tables #74

wants to merge 3 commits into from

Conversation

MilesCranmer
Copy link
Owner

This will result in tables that, in the ratio column, highlight slowdowns with red, and speedups with green. It smoothly transitions from one to the other. The brightest green is 10x speedup and brightest red is 10x slowdown.

@LilithHafner interested in your thoughts.

One concern I have is that this won't show up on GitHub, as far as I can tell, because it would print ANSI codes (since Julia thinks it is being displayed in terminal). So we would need separate styling for the GitHub markdown.

According to https://github.com/orgs/community/discussions/31570#discussioncomment-3571340 we can use LaTeX \color to get colors on GitHub. But it would mean there'd need to be an extra argument added for output parsing. Seems like it would preferable for that to be handled by StyledStrings but I guess we are GitHub-focused here already, so perhaps its fine to have this here.

@MilesCranmer MilesCranmer changed the title Colored table Colored tables Jan 29, 2025
Copy link

Benchmark Results

master 29bbe97... master/29bbe97430eaab...
main/random_sleep 0.0496 ± 0.026 s 0.417 ± 0.15 s �[38;5;46m0.119�[39m
time_to_load 1.95 ± 0.013 s 3.18 ± 0.03 s �[38;5;22m0.612�[39m

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@LilithHafner
Copy link
Contributor

Sounds like a great idea to me!

@MilesCranmer
Copy link
Owner Author

x-ref JuliaLang/StyledStrings.jl#108; would be nice to have StyledStrings.jl support GitHub coloring out-of-the-box (perhaps given some buffer to dump to). We could always hand-roll our own if needed though

@LilithHafner
Copy link
Contributor

In reviewing this table: LilithHafner/DynamicDiscreteSamplers.jl#57, I'm skimming for regressions and would appreciate the worst regression and best improvement being highlighted. Sorting would also be ideal for that use case (though that would destroy the grouping based on use-case that is currently present).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants