dataeval-plots 0.0.12__tar.gz → 0.0.13__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.
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/PKG-INFO +1 -1
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/__init__.py +40 -17
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/_version.py +2 -2
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/.gitignore +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/README.md +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/pyproject.toml +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/_registry.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/__init__.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_altair.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_base.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_feasibility_layout.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_matplotlib.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_plotly.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_seaborn.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_shared.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/protocols.py +0 -0
- {dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/py.typed +0 -0
|
@@ -198,7 +198,26 @@ def plot(
|
|
|
198
198
|
>>> plot(result, images=dataset) # Uses seaborn
|
|
199
199
|
"""
|
|
200
200
|
plotting_backend = get_backend(backend)
|
|
201
|
-
return plotting_backend.plot(output, figsize=figsize, **kwargs)
|
|
201
|
+
return _display_once(plotting_backend.plot(output, figsize=figsize, **kwargs))
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def _display_once(result: Any) -> Any:
|
|
205
|
+
"""
|
|
206
|
+
Close a returned matplotlib figure under the notebook inline backend, so the notebook draws it once.
|
|
207
|
+
|
|
208
|
+
The inline backend draws every open pyplot figure when a cell ends, and the notebook draws a returned figure as
|
|
209
|
+
the cell's value, so an open returned figure appears twice. Closing it leaves the returned value as the only
|
|
210
|
+
drawing. Under any other backend the figure stays open for ``plt.show()``, and a list of figures is left open
|
|
211
|
+
because a notebook shows a list as text.
|
|
212
|
+
"""
|
|
213
|
+
import matplotlib
|
|
214
|
+
from matplotlib.figure import Figure
|
|
215
|
+
|
|
216
|
+
if isinstance(result, Figure) and "inline" in matplotlib.get_backend().lower():
|
|
217
|
+
import matplotlib.pyplot as plt
|
|
218
|
+
|
|
219
|
+
plt.close(result)
|
|
220
|
+
return result
|
|
202
221
|
|
|
203
222
|
|
|
204
223
|
def project(
|
|
@@ -319,14 +338,16 @@ def project(
|
|
|
319
338
|
)
|
|
320
339
|
for m in methods
|
|
321
340
|
]
|
|
322
|
-
return
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
341
|
+
return _display_once(
|
|
342
|
+
plotting_backend.project_grid(
|
|
343
|
+
reduced_list,
|
|
344
|
+
methods=methods,
|
|
345
|
+
labels=labels_array,
|
|
346
|
+
label_names=label_names,
|
|
347
|
+
dimensions=dimensions,
|
|
348
|
+
figsize=figsize,
|
|
349
|
+
title=title,
|
|
350
|
+
)
|
|
330
351
|
)
|
|
331
352
|
|
|
332
353
|
# Single method
|
|
@@ -347,12 +368,14 @@ def project(
|
|
|
347
368
|
)
|
|
348
369
|
dimensions = embeddings_array.shape[1] # type: ignore[assignment]
|
|
349
370
|
|
|
350
|
-
return
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
371
|
+
return _display_once(
|
|
372
|
+
plotting_backend.project(
|
|
373
|
+
embeddings_array,
|
|
374
|
+
labels=labels_array,
|
|
375
|
+
label_names=label_names,
|
|
376
|
+
method=method or "custom",
|
|
377
|
+
dimensions=dimensions,
|
|
378
|
+
figsize=figsize,
|
|
379
|
+
title=title,
|
|
380
|
+
)
|
|
358
381
|
)
|
|
@@ -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.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
21
|
+
__version__ = version = '0.0.13'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 0, 13)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dataeval_plots-0.0.12 → dataeval_plots-0.0.13}/src/dataeval_plots/backends/_feasibility_layout.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|