dataeval-plots 0.0.8__tar.gz → 0.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: dataeval-plots
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: DataEval companion package for plotting utilities
5
5
  Project-URL: Homepage, https://dataeval.ai/
6
6
  Project-URL: Repository, https://github.com/aria-ml/dataeval/
@@ -127,6 +127,13 @@ source = ["src/dataeval_plots"]
127
127
  branch = true
128
128
  omit = ["src/dataeval_plots/_version.py"]
129
129
 
130
+ # Remap coverage data recorded under any checkout root (CI runner, container, local
131
+ # clone) onto this tree, so `coverage combine` resolves files no matter where each
132
+ # matrix leg ran. Replaces a `cp --recursive $(pwd) /dataeval-plots` step that
133
+ # used to sit in the CI coverage job.
134
+ [tool.coverage.paths]
135
+ source = ["src/dataeval_plots", "*/src/dataeval_plots"]
136
+
130
137
  [tool.coverage.report]
131
138
  exclude_also = [
132
139
  "raise NotImplementedError",
@@ -39,7 +39,7 @@ __all__ = [
39
39
  def plot(
40
40
  output: PlottableBalance,
41
41
  /,
42
- figsize: tuple[int, int] | None = None,
42
+ figsize: tuple[float, float] | None = None,
43
43
  backend: str | None = None,
44
44
  *,
45
45
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
@@ -52,7 +52,7 @@ def plot(
52
52
  def plot(
53
53
  output: PlottableDiversity,
54
54
  /,
55
- figsize: tuple[int, int] | None = None,
55
+ figsize: tuple[float, float] | None = None,
56
56
  backend: str | None = None,
57
57
  *,
58
58
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
@@ -65,7 +65,7 @@ def plot(
65
65
  def plot(
66
66
  output: PlottableSufficiency,
67
67
  /,
68
- figsize: tuple[int, int] | None = None,
68
+ figsize: tuple[float, float] | None = None,
69
69
  backend: str | None = None,
70
70
  *,
71
71
  class_names: Sequence[str] | None = None,
@@ -79,7 +79,7 @@ def plot(
79
79
  def plot(
80
80
  output: PlottableStats,
81
81
  /,
82
- figsize: tuple[int, int] | None = None,
82
+ figsize: tuple[float, float] | None = None,
83
83
  backend: str | None = None,
84
84
  *,
85
85
  log: bool = True,
@@ -92,7 +92,7 @@ def plot(
92
92
  def plot(
93
93
  output: PlottableDriftMVDC,
94
94
  /,
95
- figsize: tuple[int, int] | None = None,
95
+ figsize: tuple[float, float] | None = None,
96
96
  backend: str | None = None,
97
97
  ) -> Any: ...
98
98
 
@@ -101,7 +101,7 @@ def plot(
101
101
  def plot(
102
102
  output: Dataset,
103
103
  /,
104
- figsize: tuple[int, int] | None = None,
104
+ figsize: tuple[float, float] | None = None,
105
105
  backend: str | None = None,
106
106
  *,
107
107
  indices: Sequence[int],
@@ -116,14 +116,14 @@ def plot(
116
116
  def plot(
117
117
  output: PlottableType,
118
118
  /,
119
- figsize: tuple[int, int] | None = None,
119
+ figsize: tuple[float, float] | None = None,
120
120
  backend: str | None = None,
121
121
  **kwargs: Any,
122
122
  ) -> Any: ...
123
123
 
124
124
 
125
125
  def plot(
126
- output: PlottableType, /, figsize: tuple[int, int] | None = None, backend: str | None = None, **kwargs: Any
126
+ output: PlottableType, /, figsize: tuple[float, float] | None = None, backend: str | None = None, **kwargs: Any
127
127
  ) -> Any:
128
128
  """
129
129
  Plot any DataEval output object.
@@ -132,7 +132,7 @@ def plot(
132
132
  ----------
133
133
  output : Plottable
134
134
  DataEval output object to visualize (must implement Plottable protocol)
135
- figsize : tuple[int, int] or None, default None
135
+ figsize : tuple[float, float] or None, default None
136
136
  Figure size in inches (width, height). If None, uses backend defaults.
137
137
  backend : str or None, default None
138
138
  Plotting backend ('matplotlib', 'seaborn', 'plotly', 'altair').
@@ -182,7 +182,7 @@ def project(
182
182
  dimensions: Literal[2, 3] = 2,
183
183
  labels: ArrayLike | None = None,
184
184
  label_names: Mapping[int, str] | None = None,
185
- figsize: tuple[int, int] | None = None,
185
+ figsize: tuple[float, float] | None = None,
186
186
  backend: str | None = None,
187
187
  title: str | None = None,
188
188
  perplexity: float = 30.0,
@@ -223,7 +223,7 @@ def project(
223
223
  Class labels for coloring points, shape ``(N,)``.
224
224
  label_names : dict[int, str] or None, default None
225
225
  Mapping from integer labels to display names for the legend.
226
- figsize : tuple[int, int] or None, default None
226
+ figsize : tuple[float, float] or None, default None
227
227
  Figure size in inches (width, height).
228
228
  backend : str or None, default None
229
229
  Plotting backend (``"matplotlib"``, ``"seaborn"``, ``"plotly"``,
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.0.8'
22
- __version_tuple__ = version_tuple = (0, 0, 8)
21
+ __version__ = version = '0.0.9'
22
+ __version_tuple__ = version_tuple = (0, 0, 9)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -44,7 +44,7 @@ class AltairBackend(BasePlottingBackend):
44
44
  def _plot_balance(
45
45
  self,
46
46
  output: PlottableBalance,
47
- figsize: tuple[int, int] | None = None,
47
+ figsize: tuple[float, float] | None = None,
48
48
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
49
49
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
50
50
  plot_classwise: bool = False,
@@ -56,7 +56,7 @@ class AltairBackend(BasePlottingBackend):
56
56
  ----------
57
57
  output : PlottableBalance
58
58
  The balance output object to plot
59
- figsize : tuple[int, int] | None, default None
59
+ figsize : tuple[float, float] | None, default None
60
60
  Figure size in inches (width, height)
61
61
  row_labels : ArrayLike or None, default None
62
62
  List/Array containing the labels for rows in the histogram
@@ -142,7 +142,7 @@ class AltairBackend(BasePlottingBackend):
142
142
  def _plot_diversity(
143
143
  self,
144
144
  output: PlottableDiversity,
145
- figsize: tuple[int, int] | None = None,
145
+ figsize: tuple[float, float] | None = None,
146
146
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
147
147
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
148
148
  plot_classwise: bool = False,
@@ -154,7 +154,7 @@ class AltairBackend(BasePlottingBackend):
154
154
  ----------
155
155
  output : PlottableDiversity
156
156
  The diversity output object to plot
157
- figsize : tuple[int, int] | None, default None
157
+ figsize : tuple[float, float] | None, default None
158
158
  Figure size in inches (width, height)
159
159
  row_labels : ArrayLike or None, default None
160
160
  List/Array containing the labels for rows in the histogram
@@ -244,7 +244,7 @@ class AltairBackend(BasePlottingBackend):
244
244
  def _plot_sufficiency(
245
245
  self,
246
246
  output: PlottableSufficiency,
247
- figsize: tuple[int, int] | None = None,
247
+ figsize: tuple[float, float] | None = None,
248
248
  class_names: Sequence[str] | None = None,
249
249
  show_error_bars: bool = True,
250
250
  show_asymptote: bool = True,
@@ -257,7 +257,7 @@ class AltairBackend(BasePlottingBackend):
257
257
  ----------
258
258
  output : PlottableSufficiency
259
259
  The sufficiency output object to plot
260
- figsize : tuple[int, int] | None, default None
260
+ figsize : tuple[float, float] | None, default None
261
261
  Figure size in inches (width, height)
262
262
  class_names : Sequence[str] | None, default None
263
263
  List of class names
@@ -442,7 +442,7 @@ class AltairBackend(BasePlottingBackend):
442
442
  def _plot_stats(
443
443
  self,
444
444
  output: PlottableStats,
445
- figsize: tuple[int, int] | None = None,
445
+ figsize: tuple[float, float] | None = None,
446
446
  log: bool = True,
447
447
  channel_limit: int | None = None,
448
448
  channel_index: int | Iterable[int] | None = None,
@@ -454,7 +454,7 @@ class AltairBackend(BasePlottingBackend):
454
454
  ----------
455
455
  output : PlottableStats
456
456
  The stats output object to plot
457
- figsize : tuple[int, int] | None, default None
457
+ figsize : tuple[float, float] | None, default None
458
458
  Figure size in inches (width, height) - applied to overall grid size
459
459
  log : bool, default True
460
460
  If True, plots the histograms on a logarithmic scale.
@@ -567,7 +567,7 @@ class AltairBackend(BasePlottingBackend):
567
567
  def _plot_drift_mvdc(
568
568
  self,
569
569
  output: PlottableDriftMVDC,
570
- figsize: tuple[int, int] | None = None,
570
+ figsize: tuple[float, float] | None = None,
571
571
  ) -> Any: # alt.Chart
572
572
  """
573
573
  Render the roc_auc metric over the train/test data in relation to the threshold.
@@ -576,7 +576,7 @@ class AltairBackend(BasePlottingBackend):
576
576
  ----------
577
577
  output : PlottableDriftMVDC
578
578
  The drift MVDC output object to plot
579
- figsize : tuple[int, int] | None, default None
579
+ figsize : tuple[float, float] | None, default None
580
580
  Figure size in inches (width, height)
581
581
 
582
582
  Returns
@@ -678,7 +678,7 @@ class AltairBackend(BasePlottingBackend):
678
678
  dataset: Dataset,
679
679
  indices: Sequence[int],
680
680
  images_per_row: int = 3,
681
- figsize: tuple[int, int] | None = None,
681
+ figsize: tuple[float, float] | None = None,
682
682
  show_labels: bool = False,
683
683
  show_metadata: bool = False,
684
684
  additional_metadata: Sequence[dict[str, Any]] | None = None,
@@ -694,7 +694,7 @@ class AltairBackend(BasePlottingBackend):
694
694
  Indices of images to plot from the dataset
695
695
  images_per_row : int, default 3
696
696
  Number of images to display per row
697
- figsize : tuple[int, int] or None, default None
697
+ figsize : tuple[float, float] or None, default None
698
698
  Figure size in inches (width, height)
699
699
  show_labels : bool, default False
700
700
  Whether to display labels extracted from targets
@@ -889,7 +889,7 @@ class AltairBackend(BasePlottingBackend):
889
889
  label_names: Mapping[int, str] | None = None,
890
890
  method: str = "pca",
891
891
  dimensions: Literal[2, 3] = 2,
892
- figsize: tuple[int, int] | None = None,
892
+ figsize: tuple[float, float] | None = None,
893
893
  title: str | None = None,
894
894
  ) -> Any: # alt.Chart
895
895
  """
@@ -907,7 +907,7 @@ class AltairBackend(BasePlottingBackend):
907
907
  Name of the reduction method used (for title/display).
908
908
  dimensions : {2, 3}, default 2
909
909
  Number of dimensions in the embeddings.
910
- figsize : tuple[int, int] or None, default None
910
+ figsize : tuple[float, float] or None, default None
911
911
  Figure size in inches (width, height).
912
912
  title : str or None, default None
913
913
  Plot title. If None, auto-generated from method name.
@@ -945,7 +945,7 @@ class AltairBackend(BasePlottingBackend):
945
945
  labels: NDArray[Any] | None = None,
946
946
  label_names: Mapping[int, str] | None = None,
947
947
  dimensions: Literal[2, 3] = 2,
948
- figsize: tuple[int, int] | None = None,
948
+ figsize: tuple[float, float] | None = None,
949
949
  title: str | None = None,
950
950
  ) -> Any: # alt.VConcatChart | alt.HConcatChart | alt.Chart
951
951
  """
@@ -963,7 +963,7 @@ class AltairBackend(BasePlottingBackend):
963
963
  Mapping from integer labels to display names.
964
964
  dimensions : {2, 3}, default 2
965
965
  Number of dimensions in the embeddings.
966
- figsize : tuple[int, int] or None, default None
966
+ figsize : tuple[float, float] or None, default None
967
967
  Figure size in inches (width, height) for the entire grid.
968
968
  title : str or None, default None
969
969
  Overall title for the grid figure.
@@ -32,7 +32,7 @@ class PlottingBackend(Protocol):
32
32
  self,
33
33
  output: PlottableBalance,
34
34
  *,
35
- figsize: tuple[int, int] | None = None,
35
+ figsize: tuple[float, float] | None = None,
36
36
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
37
37
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
38
38
  plot_classwise: bool = False,
@@ -43,7 +43,7 @@ class PlottingBackend(Protocol):
43
43
  self,
44
44
  output: PlottableDiversity,
45
45
  *,
46
- figsize: tuple[int, int] | None = None,
46
+ figsize: tuple[float, float] | None = None,
47
47
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
48
48
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
49
49
  plot_classwise: bool = False,
@@ -54,7 +54,7 @@ class PlottingBackend(Protocol):
54
54
  self,
55
55
  output: PlottableSufficiency,
56
56
  *,
57
- figsize: tuple[int, int] | None = None,
57
+ figsize: tuple[float, float] | None = None,
58
58
  class_names: Sequence[str] | None = None,
59
59
  show_error_bars: bool = True,
60
60
  show_asymptote: bool = True,
@@ -66,7 +66,7 @@ class PlottingBackend(Protocol):
66
66
  self,
67
67
  output: PlottableStats,
68
68
  *,
69
- figsize: tuple[int, int] | None = None,
69
+ figsize: tuple[float, float] | None = None,
70
70
  log: bool = True,
71
71
  channel_limit: int | None = None,
72
72
  channel_index: int | Iterable[int] | None = None,
@@ -77,7 +77,7 @@ class PlottingBackend(Protocol):
77
77
  self,
78
78
  output: PlottableDriftMVDC,
79
79
  *,
80
- figsize: tuple[int, int] | None = None,
80
+ figsize: tuple[float, float] | None = None,
81
81
  ) -> Any: ...
82
82
 
83
83
  @overload
@@ -85,7 +85,7 @@ class PlottingBackend(Protocol):
85
85
  self,
86
86
  output: Dataset,
87
87
  *,
88
- figsize: tuple[int, int] | None = None,
88
+ figsize: tuple[float, float] | None = None,
89
89
  indices: Sequence[int],
90
90
  images_per_row: int = 3,
91
91
  show_labels: bool = False,
@@ -94,9 +94,9 @@ class PlottingBackend(Protocol):
94
94
  ) -> Any: ...
95
95
 
96
96
  @overload
97
- def plot(self, output: PlottableType, *, figsize: tuple[int, int] | None = None, **kwargs: Any) -> Any: ...
97
+ def plot(self, output: PlottableType, *, figsize: tuple[float, float] | None = None, **kwargs: Any) -> Any: ...
98
98
 
99
- def plot(self, output: PlottableType, *, figsize: tuple[int, int] | None = None, **kwargs: Any) -> Any:
99
+ def plot(self, output: PlottableType, *, figsize: tuple[float, float] | None = None, **kwargs: Any) -> Any:
100
100
  """
101
101
  Plot output using this backend.
102
102
 
@@ -104,7 +104,7 @@ class PlottingBackend(Protocol):
104
104
  ----------
105
105
  output : Plottable
106
106
  DataEval output to visualize (must implement Plottable protocol)
107
- figsize : tuple[int, int] or None, default None
107
+ figsize : tuple[float, float] or None, default None
108
108
  Figure size in inches (width, height). If None, uses backend defaults.
109
109
  **kwargs
110
110
  Backend-specific parameters
@@ -123,7 +123,7 @@ class PlottingBackend(Protocol):
123
123
  label_names: Mapping[int, str] | None = None,
124
124
  method: str = "pca",
125
125
  dimensions: Literal[2, 3] = 2,
126
- figsize: tuple[int, int] | None = None,
126
+ figsize: tuple[float, float] | None = None,
127
127
  title: str | None = None,
128
128
  ) -> Any:
129
129
  """
@@ -141,7 +141,7 @@ class PlottingBackend(Protocol):
141
141
  Name of the reduction method used (for title/display).
142
142
  dimensions : {2, 3}, default 2
143
143
  Number of dimensions in the embeddings.
144
- figsize : tuple[int, int] or None, default None
144
+ figsize : tuple[float, float] or None, default None
145
145
  Figure size in inches (width, height).
146
146
  title : str or None, default None
147
147
  Plot title. If None, auto-generated from method name.
@@ -160,7 +160,7 @@ class PlottingBackend(Protocol):
160
160
  labels: NDArray[Any] | None = None,
161
161
  label_names: Mapping[int, str] | None = None,
162
162
  dimensions: Literal[2, 3] = 2,
163
- figsize: tuple[int, int] | None = None,
163
+ figsize: tuple[float, float] | None = None,
164
164
  title: str | None = None,
165
165
  ) -> Any:
166
166
  """
@@ -179,7 +179,7 @@ class PlottingBackend(Protocol):
179
179
  Mapping from integer labels to display names.
180
180
  dimensions : {2, 3}, default 2
181
181
  Number of dimensions in the embeddings.
182
- figsize : tuple[int, int] or None, default None
182
+ figsize : tuple[float, float] or None, default None
183
183
  Figure size in inches (width, height) for the entire grid.
184
184
  title : str or None, default None
185
185
  Overall title for the grid figure.
@@ -199,7 +199,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
199
199
  to abstract methods that subclasses must implement.
200
200
  """
201
201
 
202
- def plot(self, output: PlottableType, *, figsize: tuple[int, int] | None = None, **kwargs: Any) -> Any:
202
+ def plot(self, output: PlottableType, *, figsize: tuple[float, float] | None = None, **kwargs: Any) -> Any:
203
203
  """
204
204
  Route to appropriate plot method based on output plot_type.
205
205
 
@@ -207,7 +207,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
207
207
  ----------
208
208
  output : Plottable
209
209
  DataEval output object implementing Plottable protocol
210
- figsize : tuple[int, int] or None, default None
210
+ figsize : tuple[float, float] or None, default None
211
211
  Figure size in inches (width, height). If None, uses backend defaults.
212
212
  **kwargs
213
213
  Plotting parameters
@@ -244,7 +244,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
244
244
  def _plot_balance(
245
245
  self,
246
246
  output: PlottableBalance,
247
- figsize: tuple[int, int] | None = None,
247
+ figsize: tuple[float, float] | None = None,
248
248
  row_labels: Sequence[Any] | Any | None = None,
249
249
  col_labels: Sequence[Any] | Any | None = None,
250
250
  plot_classwise: bool = False,
@@ -256,7 +256,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
256
256
  def _plot_diversity(
257
257
  self,
258
258
  output: PlottableDiversity,
259
- figsize: tuple[int, int] | None = None,
259
+ figsize: tuple[float, float] | None = None,
260
260
  row_labels: Sequence[Any] | Any | None = None,
261
261
  col_labels: Sequence[Any] | Any | None = None,
262
262
  plot_classwise: bool = False,
@@ -268,7 +268,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
268
268
  def _plot_sufficiency(
269
269
  self,
270
270
  output: PlottableSufficiency,
271
- figsize: tuple[int, int] | None = None,
271
+ figsize: tuple[float, float] | None = None,
272
272
  class_names: Sequence[str] | None = None,
273
273
  show_error_bars: bool = True,
274
274
  show_asymptote: bool = True,
@@ -281,7 +281,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
281
281
  def _plot_stats(
282
282
  self,
283
283
  output: PlottableStats,
284
- figsize: tuple[int, int] | None = None,
284
+ figsize: tuple[float, float] | None = None,
285
285
  log: bool = True,
286
286
  channel_limit: int | None = None,
287
287
  channel_index: int | Iterable[int] | None = None,
@@ -293,7 +293,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
293
293
  def _plot_drift_mvdc(
294
294
  self,
295
295
  output: PlottableDriftMVDC,
296
- figsize: tuple[int, int] | None = None,
296
+ figsize: tuple[float, float] | None = None,
297
297
  ) -> Any:
298
298
  """Plot drift MVDC output."""
299
299
  ...
@@ -303,7 +303,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
303
303
  dataset: Dataset,
304
304
  indices: Sequence[int],
305
305
  images_per_row: int = 3,
306
- figsize: tuple[int, int] | None = None,
306
+ figsize: tuple[float, float] | None = None,
307
307
  show_labels: bool = False,
308
308
  show_metadata: bool = False,
309
309
  additional_metadata: Sequence[dict[str, Any]] | None = None,
@@ -322,7 +322,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
322
322
  Indices of images to plot from the dataset
323
323
  images_per_row : int, default 3
324
324
  Number of images to display per row
325
- figsize : tuple[int, int] or None, default None
325
+ figsize : tuple[float, float] or None, default None
326
326
  Figure size in inches (width, height)
327
327
  show_labels : bool, default False
328
328
  Whether to display labels extracted from targets
@@ -431,7 +431,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
431
431
  label_names: Mapping[int, str] | None = None,
432
432
  method: str = "pca",
433
433
  dimensions: Literal[2, 3] = 2,
434
- figsize: tuple[int, int] | None = None,
434
+ figsize: tuple[float, float] | None = None,
435
435
  title: str | None = None,
436
436
  ) -> Figure:
437
437
  """
@@ -452,7 +452,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
452
452
  Name of the reduction method used (for title/display).
453
453
  dimensions : {2, 3}, default 2
454
454
  Number of dimensions in the embeddings.
455
- figsize : tuple[int, int] or None, default None
455
+ figsize : tuple[float, float] or None, default None
456
456
  Figure size in inches (width, height).
457
457
  title : str or None, default None
458
458
  Plot title. If None, auto-generated from method name.
@@ -524,7 +524,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
524
524
  labels: NDArray[Any] | None = None,
525
525
  label_names: Mapping[int, str] | None = None,
526
526
  dimensions: Literal[2, 3] = 2,
527
- figsize: tuple[int, int] | None = None,
527
+ figsize: tuple[float, float] | None = None,
528
528
  title: str | None = None,
529
529
  ) -> Figure:
530
530
  """
@@ -542,7 +542,7 @@ class BasePlottingBackend(PlottingBackend, ABC):
542
542
  Mapping from integer labels to display names.
543
543
  dimensions : {2, 3}, default 2
544
544
  Number of dimensions in the embeddings.
545
- figsize : tuple[int, int] or None, default None
545
+ figsize : tuple[float, float] or None, default None
546
546
  Figure size in inches (width, height) for the entire grid.
547
547
  title : str or None, default None
548
548
  Overall title for the grid figure.
@@ -46,7 +46,7 @@ class MatplotlibBackend(BasePlottingBackend):
46
46
  xlabel: str = "",
47
47
  ylabel: str = "",
48
48
  cbarlabel: str = "",
49
- figsize: tuple[int, int] | None = None,
49
+ figsize: tuple[float, float] | None = None,
50
50
  ) -> Figure:
51
51
  """
52
52
  Plots a formatted heatmap.
@@ -164,7 +164,7 @@ class MatplotlibBackend(BasePlottingBackend):
164
164
  log: bool = True,
165
165
  xlabel: str = "values",
166
166
  ylabel: str = "counts",
167
- figsize: tuple[int, int] | None = None,
167
+ figsize: tuple[float, float] | None = None,
168
168
  ) -> Figure:
169
169
  """
170
170
  Plots a formatted histogram.
@@ -220,7 +220,7 @@ class MatplotlibBackend(BasePlottingBackend):
220
220
  ch_mask: Sequence[bool] | None = None,
221
221
  xlabel: str = "values",
222
222
  ylabel: str = "counts",
223
- figsize: tuple[int, int] | None = None,
223
+ figsize: tuple[float, float] | None = None,
224
224
  ) -> Figure:
225
225
  """
226
226
  Plots a formatted channel-wise histogram.
@@ -290,7 +290,7 @@ class MatplotlibBackend(BasePlottingBackend):
290
290
  def _plot_balance(
291
291
  self,
292
292
  output: PlottableBalance,
293
- figsize: tuple[int, int] | None = None,
293
+ figsize: tuple[float, float] | None = None,
294
294
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
295
295
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
296
296
  plot_classwise: bool = False,
@@ -333,7 +333,7 @@ class MatplotlibBackend(BasePlottingBackend):
333
333
  def _plot_diversity(
334
334
  self,
335
335
  output: PlottableDiversity,
336
- figsize: tuple[int, int] | None = None,
336
+ figsize: tuple[float, float] | None = None,
337
337
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
338
338
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
339
339
  plot_classwise: bool = False,
@@ -458,7 +458,7 @@ class MatplotlibBackend(BasePlottingBackend):
458
458
  show_asymptote: bool,
459
459
  plots: list[Figure],
460
460
  reference_outputs: Sequence[Any],
461
- figsize: tuple[int, int] | None = None,
461
+ figsize: tuple[float, float] | None = None,
462
462
  ) -> None:
463
463
  from matplotlib import pyplot as plt
464
464
 
@@ -506,7 +506,7 @@ class MatplotlibBackend(BasePlottingBackend):
506
506
  plots: list[Figure],
507
507
  reference_outputs: Sequence[Any],
508
508
  class_names: Sequence[str] | None = None,
509
- figsize: tuple[int, int] | None = None,
509
+ figsize: tuple[float, float] | None = None,
510
510
  ) -> None:
511
511
  from matplotlib import pyplot as plt
512
512
 
@@ -552,7 +552,7 @@ class MatplotlibBackend(BasePlottingBackend):
552
552
  def _plot_sufficiency(
553
553
  self,
554
554
  output: PlottableSufficiency,
555
- figsize: tuple[int, int] | None = None,
555
+ figsize: tuple[float, float] | None = None,
556
556
  class_names: Sequence[str] | None = None,
557
557
  show_error_bars: bool = True,
558
558
  show_asymptote: bool = True,
@@ -624,7 +624,7 @@ class MatplotlibBackend(BasePlottingBackend):
624
624
  def _plot_stats(
625
625
  self,
626
626
  output: PlottableStats,
627
- figsize: tuple[int, int] | None = None,
627
+ figsize: tuple[float, float] | None = None,
628
628
  log: bool = True,
629
629
  channel_limit: int | None = None,
630
630
  channel_index: int | Iterable[int] | None = None,
@@ -660,7 +660,7 @@ class MatplotlibBackend(BasePlottingBackend):
660
660
  def _plot_drift_mvdc(
661
661
  self,
662
662
  output: PlottableDriftMVDC,
663
- figsize: tuple[int, int] | None = None,
663
+ figsize: tuple[float, float] | None = None,
664
664
  ) -> Figure:
665
665
  """
666
666
  Render the roc_auc metric over the train/test data in relation to the threshold.
@@ -38,7 +38,7 @@ class PlotlyBackend(BasePlottingBackend):
38
38
  def _plot_balance(
39
39
  self,
40
40
  output: PlottableBalance,
41
- figsize: tuple[int, int] | None = None,
41
+ figsize: tuple[float, float] | None = None,
42
42
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
43
43
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
44
44
  plot_classwise: bool = False,
@@ -50,7 +50,7 @@ class PlotlyBackend(BasePlottingBackend):
50
50
  ----------
51
51
  output : PlottableBalance
52
52
  The balance output object to plot
53
- figsize : tuple[int, int] or None, default None
53
+ figsize : tuple[float, float] or None, default None
54
54
  Figure size in pixels (width, height). If None, defaults to 600x600.
55
55
  row_labels : ArrayLike or None, default None
56
56
  List/Array containing the labels for rows in the histogram
@@ -143,7 +143,7 @@ class PlotlyBackend(BasePlottingBackend):
143
143
  def _plot_diversity(
144
144
  self,
145
145
  output: PlottableDiversity,
146
- figsize: tuple[int, int] | None = None,
146
+ figsize: tuple[float, float] | None = None,
147
147
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
148
148
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
149
149
  plot_classwise: bool = False,
@@ -155,7 +155,7 @@ class PlotlyBackend(BasePlottingBackend):
155
155
  ----------
156
156
  output : PlottableDiversity
157
157
  The diversity output object to plot
158
- figsize : tuple[int, int] or None, default None
158
+ figsize : tuple[float, float] or None, default None
159
159
  Figure size in pixels (width, height). If None, defaults to 600x600 for heatmap or 700x500 for bar chart.
160
160
  row_labels : ArrayLike or None, default None
161
161
  List/Array containing the labels for rows in the histogram
@@ -258,7 +258,7 @@ class PlotlyBackend(BasePlottingBackend):
258
258
  def _plot_sufficiency(
259
259
  self,
260
260
  output: PlottableSufficiency,
261
- figsize: tuple[int, int] | None = None,
261
+ figsize: tuple[float, float] | None = None,
262
262
  class_names: Sequence[str] | None = None,
263
263
  show_error_bars: bool = True,
264
264
  show_asymptote: bool = True,
@@ -271,7 +271,7 @@ class PlotlyBackend(BasePlottingBackend):
271
271
  ----------
272
272
  output : PlottableSufficiency
273
273
  The sufficiency output object to plot
274
- figsize : tuple[int, int] or None, default None
274
+ figsize : tuple[float, float] or None, default None
275
275
  Figure size in pixels (width, height). If None, defaults to 700x500.
276
276
  class_names : Sequence[str] | None, default None
277
277
  List of class names
@@ -448,7 +448,7 @@ class PlotlyBackend(BasePlottingBackend):
448
448
  def _plot_stats(
449
449
  self,
450
450
  output: PlottableStats,
451
- figsize: tuple[int, int] | None = None,
451
+ figsize: tuple[float, float] | None = None,
452
452
  log: bool = True,
453
453
  channel_limit: int | None = None,
454
454
  channel_index: int | Iterable[int] | None = None,
@@ -460,7 +460,7 @@ class PlotlyBackend(BasePlottingBackend):
460
460
  ----------
461
461
  output : PlottableStats
462
462
  The stats output object to plot
463
- figsize : tuple[int, int] or None, default None
463
+ figsize : tuple[float, float] or None, default None
464
464
  Figure size in pixels (width, height). If None, defaults to 300 * cols x 300 * rows.
465
465
  log : bool, default True
466
466
  If True, plots the histograms on a logarithmic scale.
@@ -592,7 +592,7 @@ class PlotlyBackend(BasePlottingBackend):
592
592
  def _plot_drift_mvdc(
593
593
  self,
594
594
  output: PlottableDriftMVDC,
595
- figsize: tuple[int, int] | None = None,
595
+ figsize: tuple[float, float] | None = None,
596
596
  ) -> Any: # go.Figure
597
597
  """
598
598
  Render the roc_auc metric over the train/test data in relation to the threshold.
@@ -601,7 +601,7 @@ class PlotlyBackend(BasePlottingBackend):
601
601
  ----------
602
602
  output : PlottableDriftMVDC
603
603
  The drift MVDC output object to plot
604
- figsize : tuple[int, int] or None, default None
604
+ figsize : tuple[float, float] or None, default None
605
605
  Figure size in pixels (width, height). If None, defaults to 900x500.
606
606
 
607
607
  Returns
@@ -718,7 +718,7 @@ class PlotlyBackend(BasePlottingBackend):
718
718
  dataset: Dataset,
719
719
  indices: Sequence[int],
720
720
  images_per_row: int = 3,
721
- figsize: tuple[int, int] | None = None,
721
+ figsize: tuple[float, float] | None = None,
722
722
  show_labels: bool = False,
723
723
  show_metadata: bool = False,
724
724
  additional_metadata: Sequence[dict[str, Any]] | None = None,
@@ -734,7 +734,7 @@ class PlotlyBackend(BasePlottingBackend):
734
734
  Indices of images to plot from the dataset
735
735
  images_per_row : int, default 3
736
736
  Number of images to display per row
737
- figsize : tuple[int, int] or None, default None
737
+ figsize : tuple[float, float] or None, default None
738
738
  Figure size in pixels (width, height). If None, defaults to 1000x1000.
739
739
  show_labels : bool, default False
740
740
  Whether to display labels extracted from targets
@@ -959,7 +959,7 @@ class PlotlyBackend(BasePlottingBackend):
959
959
  label_names: Mapping[int, str] | None = None,
960
960
  method: str = "pca",
961
961
  dimensions: Literal[2, 3] = 2,
962
- figsize: tuple[int, int] | None = None,
962
+ figsize: tuple[float, float] | None = None,
963
963
  title: str | None = None,
964
964
  ) -> Any: # go.Figure
965
965
  """
@@ -977,7 +977,7 @@ class PlotlyBackend(BasePlottingBackend):
977
977
  Name of the reduction method used (for title/display).
978
978
  dimensions : {2, 3}, default 2
979
979
  Number of dimensions in the embeddings.
980
- figsize : tuple[int, int] or None, default None
980
+ figsize : tuple[float, float] or None, default None
981
981
  Figure size in inches (width, height).
982
982
  title : str or None, default None
983
983
  Plot title. If None, auto-generated from method name.
@@ -1019,7 +1019,7 @@ class PlotlyBackend(BasePlottingBackend):
1019
1019
  labels: NDArray[Any] | None = None,
1020
1020
  label_names: Mapping[int, str] | None = None,
1021
1021
  dimensions: Literal[2, 3] = 2,
1022
- figsize: tuple[int, int] | None = None,
1022
+ figsize: tuple[float, float] | None = None,
1023
1023
  title: str | None = None,
1024
1024
  ) -> Any: # go.Figure
1025
1025
  """
@@ -1037,7 +1037,7 @@ class PlotlyBackend(BasePlottingBackend):
1037
1037
  Mapping from integer labels to display names.
1038
1038
  dimensions : {2, 3}, default 2
1039
1039
  Number of dimensions in the embeddings.
1040
- figsize : tuple[int, int] or None, default None
1040
+ figsize : tuple[float, float] or None, default None
1041
1041
  Figure size in inches (width, height) for the entire grid.
1042
1042
  title : str or None, default None
1043
1043
  Overall title for the grid figure.
@@ -33,7 +33,7 @@ class SeabornBackend(BasePlottingBackend):
33
33
  def _plot_balance(
34
34
  self,
35
35
  output: PlottableBalance,
36
- figsize: tuple[int, int] | None = None,
36
+ figsize: tuple[float, float] | None = None,
37
37
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
38
38
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
39
39
  plot_classwise: bool = False,
@@ -98,7 +98,7 @@ class SeabornBackend(BasePlottingBackend):
98
98
  def _plot_diversity(
99
99
  self,
100
100
  output: PlottableDiversity,
101
- figsize: tuple[int, int] | None = None,
101
+ figsize: tuple[float, float] | None = None,
102
102
  row_labels: Sequence[Any] | NDArray[Any] | None = None,
103
103
  col_labels: Sequence[Any] | NDArray[Any] | None = None,
104
104
  plot_classwise: bool = False,
@@ -181,7 +181,7 @@ class SeabornBackend(BasePlottingBackend):
181
181
  def _plot_sufficiency(
182
182
  self,
183
183
  output: PlottableSufficiency,
184
- figsize: tuple[int, int] | None = None,
184
+ figsize: tuple[float, float] | None = None,
185
185
  class_names: Sequence[str] | None = None,
186
186
  show_error_bars: bool = True,
187
187
  show_asymptote: bool = True,
@@ -235,7 +235,7 @@ class SeabornBackend(BasePlottingBackend):
235
235
  def _plot_stats(
236
236
  self,
237
237
  output: PlottableStats,
238
- figsize: tuple[int, int] | None = None,
238
+ figsize: tuple[float, float] | None = None,
239
239
  log: bool = True,
240
240
  channel_limit: int | None = None,
241
241
  channel_index: int | Iterable[int] | None = None,
@@ -360,7 +360,7 @@ class SeabornBackend(BasePlottingBackend):
360
360
  label_names: Mapping[int, str] | None = None,
361
361
  method: str = "pca",
362
362
  dimensions: Literal[2, 3] = 2,
363
- figsize: tuple[int, int] | None = None,
363
+ figsize: tuple[float, float] | None = None,
364
364
  title: str | None = None,
365
365
  ) -> Figure:
366
366
  """
@@ -378,7 +378,7 @@ class SeabornBackend(BasePlottingBackend):
378
378
  Name of the reduction method used (for title/display).
379
379
  dimensions : {2, 3}, default 2
380
380
  Number of dimensions in the embeddings.
381
- figsize : tuple[int, int] or None, default None
381
+ figsize : tuple[float, float] or None, default None
382
382
  Figure size in inches (width, height).
383
383
  title : str or None, default None
384
384
  Plot title. If None, auto-generated from method name.
@@ -403,7 +403,7 @@ class SeabornBackend(BasePlottingBackend):
403
403
  labels: NDArray[Any] | None = None,
404
404
  label_names: Mapping[int, str] | None = None,
405
405
  dimensions: Literal[2, 3] = 2,
406
- figsize: tuple[int, int] | None = None,
406
+ figsize: tuple[float, float] | None = None,
407
407
  title: str | None = None,
408
408
  ) -> Figure:
409
409
  """Plot a grid of projected embeddings with Seaborn styling."""
@@ -419,7 +419,7 @@ class SeabornBackend(BasePlottingBackend):
419
419
  def _plot_drift_mvdc(
420
420
  self,
421
421
  output: PlottableDriftMVDC,
422
- figsize: tuple[int, int] | None = None,
422
+ figsize: tuple[float, float] | None = None,
423
423
  ) -> Figure:
424
424
  """
425
425
  Render the roc_auc metric over the train/test data using Seaborn styling.
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import contextlib
6
+ import inspect
6
7
  import io
7
8
  from collections.abc import Sequence
8
9
  from typing import TYPE_CHECKING, Any, Literal
@@ -153,15 +154,28 @@ def reduce_embeddings(
153
154
  elif method == "mds":
154
155
  from sklearn.manifold import MDS
155
156
 
156
- reducer = MDS(
157
- n_components=dimensions,
158
- metric_mds=False,
159
- random_state=random_state,
160
- normalized_stress="auto",
161
- n_init=4, # type: ignore[arg-type]
162
- init="random",
163
- max_iter=300,
164
- )
157
+ # scikit-learn 1.8 renamed the non-metric switch from `metric` to `metric_mds`
158
+ # -- `metric` now names the distance metric -- and moved `init` from fit() onto
159
+ # the constructor. 1.8 requires Python >=3.11, so on the 3.10 leg the lockfile
160
+ # necessarily resolves 1.7.x, where neither new spelling exists.
161
+ #
162
+ # Ask the signature rather than compare version strings: it needs no extra
163
+ # dependency and tests exactly the thing being depended on. Omitting `init` on
164
+ # 1.7.x is not a behaviour change -- smacof already initialises randomly from
165
+ # `random_state` when init is left unset.
166
+ mds_kwargs: dict[str, Any] = {
167
+ "n_components": dimensions,
168
+ "random_state": random_state,
169
+ "normalized_stress": "auto",
170
+ "n_init": 4,
171
+ "max_iter": 300,
172
+ }
173
+ if "metric_mds" in inspect.signature(MDS.__init__).parameters:
174
+ mds_kwargs["metric_mds"] = False
175
+ mds_kwargs["init"] = "random"
176
+ else:
177
+ mds_kwargs["metric"] = False
178
+ reducer = MDS(**mds_kwargs)
165
179
  elif method == "spectral":
166
180
  from sklearn.manifold import SpectralEmbedding
167
181
 
File without changes