From 7dcb1970373fe32fba2160d89d6286db104ea091 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Fri, 10 Jan 2025 19:33:35 +0100 Subject: [PATCH] chore: Use emoji markup as proposed in rich (#1089) Instead of using the direct emoji, let's change it to the markup one. However, it does not fix the issue in width in ipython. --- skore/src/skore/sklearn/_estimator/metrics_accessor.py | 6 +++--- skore/src/skore/sklearn/_estimator/report.py | 8 ++++---- skore/src/skore/sklearn/_plot/utils.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/skore/src/skore/sklearn/_estimator/metrics_accessor.py b/skore/src/skore/sklearn/_estimator/metrics_accessor.py index 0f41595ac..40869210b 100644 --- a/skore/src/skore/sklearn/_estimator/metrics_accessor.py +++ b/skore/src/skore/sklearn/_estimator/metrics_accessor.py @@ -42,7 +42,7 @@ class _MetricsAccessor(_BaseAccessor, DirNamesMixin): } def __init__(self, parent): - super().__init__(parent, icon="📏") + super().__init__(parent, icon=":straight_ruler:") # TODO: should build on the `add_scorers` function def report_metrics( @@ -796,7 +796,7 @@ def _create_help_tree(self): tree = super()._create_help_tree() # Add plot methods in a separate branch - plot_branch = tree.add("[bold cyan].plot 🎨[/bold cyan]") + plot_branch = tree.add("[bold cyan].plot :art:[/bold cyan]") plot_methods = self.plot._get_methods_for_help() plot_methods = self.plot._sort_methods_for_help(plot_methods) @@ -829,7 +829,7 @@ class _PlotMetricsAccessor(_BaseAccessor): """Plotting methods for the metrics accessor.""" def __init__(self, parent): - super().__init__(parent._parent, icon="🎨") + super().__init__(parent._parent, icon=":art:") self._metrics_parent = parent def _get_display( diff --git a/skore/src/skore/sklearn/_estimator/report.py b/skore/src/skore/sklearn/_estimator/report.py index 294f48851..a99fa7cb4 100644 --- a/skore/src/skore/sklearn/_estimator/report.py +++ b/skore/src/skore/sklearn/_estimator/report.py @@ -67,10 +67,10 @@ class EstimatorReport(_HelpMixin, DirNamesMixin): """ _ACCESSOR_CONFIG = { - "metrics": {"icon": "📏", "name": "metrics"}, + "metrics": {"icon": ":straight_ruler:", "name": "metrics"}, # Add other accessors as they're implemented - # "inspection": {"icon": "🔍", "name": "inspection"}, - # "linting": {"icon": "✔️", "name": "linting"}, + # "inspection": {"icon": ":magnifying_glass:", "name": "inspection"}, + # "linting": {"icon": ":check:", "name": "linting"}, } @staticmethod @@ -338,7 +338,7 @@ def _get_cached_response_values( def _get_help_panel_title(self): return ( - f"[bold cyan]📓 Tools to diagnose estimator " + f"[bold cyan]:notebook: Tools to diagnose estimator " f"{self.estimator_name}[/bold cyan]" ) diff --git a/skore/src/skore/sklearn/_plot/utils.py b/skore/src/skore/sklearn/_plot/utils.py index 14e24bedb..2b995b1bb 100644 --- a/skore/src/skore/sklearn/_plot/utils.py +++ b/skore/src/skore/sklearn/_plot/utils.py @@ -66,8 +66,8 @@ def _create_help_panel(self): return Panel( self._create_help_tree(), title=( - f"[bold cyan]📊 {self.__class__.__name__} for {self.estimator_name}" - "[/bold cyan]" + f"[bold cyan]:bar_chart: {self.__class__.__name__} for " + f"{self.estimator_name}[/bold cyan]" ), border_style="orange1", expand=False,