VIZ format table cells with markers - #993
Open
etyl wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Generated with: from benchopt import BasePlot
class Plot(BasePlot):
name = "Custom table"
type = "table"
options = {
"dataset": ...,
}
def plot(self, df, dataset):
df = df[df['dataset_name'] == dataset]
# Last value reached by each solver, median over the repetitions
results = (
df.select_dtypes(include=['number'])
.join(df['solver_name'])
.groupby(['solver_name', 'stop_val'])
.median()
.groupby('solver_name')
.last()
)
best = results['objective_value'].idxmin()
return [
[
f"**{solver}**" if solver == best else solver,
f"**{res['objective_value']}**" if solver == best else res['objective_value'],
res['time'],
"__best objective__" if solver == best else r"*runner-up\**",
]
for solver, res in results.iterrows()
]
def get_metadata(self, df, dataset):
return {
"title": f"Custom table\nData: {dataset}",
"columns": ["solver", "objective_value", "time (s)", "comment"],
"default_order_column": "objective_value",
"default_order_ascending": True,
} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #993 +/- ##
=======================================
Coverage 87.75% 87.75%
=======================================
Files 56 56
Lines 4581 4581
=======================================
Hits 4020 4020
Misses 561 561 🚀 New features to boost your workflow:
|
Contributor
Author
|
What do you think @tomMoral ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Table cells can now be formatted with some simple markers (bold, italic and underlines), works with text and numbers. This is useful when we want to highlight the best results in a table for example.
Checks before merging PR
added unit test