From 6efd0b4fc20409cb2396b5393a38256f2d5ea0c5 Mon Sep 17 00:00:00 2001 From: samuelesabella Date: Thu, 5 Nov 2026 16:13:25 +0100 Subject: [PATCH 1/3] dnotebooks/widgets/selection.py: ExperimentGroupMetrics add time data --- dnotebooks/widgets/selection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dnotebooks/widgets/selection.py b/dnotebooks/widgets/selection.py index 79f9ab2..a58a40a 100644 --- a/dnotebooks/widgets/selection.py +++ b/dnotebooks/widgets/selection.py @@ -35,7 +35,8 @@ def aggregate_mean(self) -> ExperimentMetric: if len(self.metrics) == 1: return ExperimentConfusionMatrix( devices_confusion_matrices=m0.data, - description=m0.description + description=m0.description, + time_devices_confusion_matrices=m0.time_data ) metrics_mean = [m.mean() for m in self.metrics] @@ -330,7 +331,7 @@ def ConfusionMatrixPartitionMultiSelection( experiments_groups: List[ExperimentGroup], description: str = "Select confusion matrix:" ): - def get_selection() -> Optional[Dict[str, ExperimentConfusionMatrix]]: + def get_confusion_matrix() -> Optional[Dict[str, ExperimentConfusionMatrix]]: if confusion_matrix_selection.value is None: return matrices = {} @@ -358,4 +359,4 @@ def get_selection() -> Optional[Dict[str, ExperimentConfusionMatrix]]: confusion_matrix_selection ], layout=layout) - return widget, get_selection + return widget, get_confusion_matrix From 9c0c5281bf9a0b1acac3611b6d8d77c6b4041a5f Mon Sep 17 00:00:00 2001 From: samuelesabella Date: Thu, 5 Nov 2026 16:14:06 +0100 Subject: [PATCH 2/3] dnotebooks/plots/plots.py: reduce alpha --- dnotebooks/plots/plots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnotebooks/plots/plots.py b/dnotebooks/plots/plots.py index 69f6371..3c63802 100644 --- a/dnotebooks/plots/plots.py +++ b/dnotebooks/plots/plots.py @@ -762,7 +762,7 @@ def draw(self): seeds_confusion_matrices, self.epoch[0], self.epoch[1] )[:len(Y)] - self._ax.fill_between(X, Y_lower_bound, Y_upper_bound, color=c, alpha=.3) + self._ax.fill_between(X, Y_lower_bound, Y_upper_bound, color=c, alpha=.1) self._ax.plot(X, Y, color=c, label=label, alpha=1, **linestyle) if self.ylimit: From e5e10814b59caf25f25b6298d0531e62cda06012 Mon Sep 17 00:00:00 2001 From: samuelesabella Date: Thu, 5 Nov 2026 16:14:31 +0100 Subject: [PATCH 3/3] dnotebooks/utils.py: improve linestyles --- dnotebooks/utils.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/dnotebooks/utils.py b/dnotebooks/utils.py index 68a8e56..01b2ce9 100644 --- a/dnotebooks/utils.py +++ b/dnotebooks/utils.py @@ -54,6 +54,8 @@ def get(self, key: str) -> str: @dataclass class LineStyle: DEFAULT = 'solid' + MARKERS = ['*', 'o', 's', 'D'] + LINESTYLES = ['solid', 'dashed', 'dotted'] STYLE_OPTIONS = [ 'solid', 'dashed', @@ -61,7 +63,15 @@ class LineStyle: '*', 'o', 's', - 'D' + 'D', + 'dashed-o', + 'dashed-s', + 'dashed-D', + 'dashed-*', + 'dotted-o', + 'dotted-s', + 'dotted-D', + 'dotted-*', ] linestyle: Optional[str] = None @@ -77,6 +87,13 @@ def to_kwargs(self): @staticmethod def resolve(label: Optional[str]) -> LineStyle: - if label in ['*', 'o', 's', 'D']: + if label is None: + return LineStyle(None, None) + if label in LineStyle.MARKERS: return LineStyle('solid', label) + if '-' in label: + linestyle, marker = label.split('-', 1) + if linestyle in LineStyle.LINESTYLES and marker in LineStyle.MARKERS: + return LineStyle(linestyle, marker) + raise ValueError(f"Unknown line style: {label!r}") return LineStyle(label, None)