From 0cc0c2e04273e9b135709054ab982e81ca0282e1 Mon Sep 17 00:00:00 2001 From: StevenBtw Date: Mon, 16 Mar 2026 13:55:14 +0100 Subject: [PATCH 1/2] ruff check --- examples/fashion-mnist-parallel-coords-6d.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/fashion-mnist-parallel-coords-6d.py b/examples/fashion-mnist-parallel-coords-6d.py index 64d51c2..1cec730 100644 --- a/examples/fashion-mnist-parallel-coords-6d.py +++ b/examples/fashion-mnist-parallel-coords-6d.py @@ -258,13 +258,11 @@ def _(LABEL_COLORS, idx, images, label_names, labels, np, plt, vs, widget): _selected_ids = set(vs.widget.selected_points or []) _filtered = widget.widget.filtered_indices - if _selected_ids: - _show = [ - _i for _i in range(len(idx)) - if f"p_{_i}" in _selected_ids - ][:10] - else: - _show = list(_filtered[:10]) + _show = ( + [_i for _i in range(len(idx)) if f"p_{_i}" in _selected_ids][:10] + if _selected_ids + else list(_filtered[:10]) + ) _sample_idx = np.array(_show) if len(_show) > 0 else np.array([0]) From e5daa8ed0df0c7f024ca17520c0926674ab1dab7 Mon Sep 17 00:00:00 2001 From: StevenBtw Date: Mon, 16 Mar 2026 14:33:59 +0100 Subject: [PATCH 2/2] ruff format --- examples/fashion-mnist-parallel-coords-6d.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/fashion-mnist-parallel-coords-6d.py b/examples/fashion-mnist-parallel-coords-6d.py index 1cec730..6a691f9 100644 --- a/examples/fashion-mnist-parallel-coords-6d.py +++ b/examples/fashion-mnist-parallel-coords-6d.py @@ -34,6 +34,7 @@ def _(): from wigglystuff import ParallelCoordinates from anywidget_vector import VectorSpace + return PCA, ParallelCoordinates, VectorSpace, fetch_openml, mo, np, pl, plt @@ -244,10 +245,12 @@ def _(LABEL_COLORS, ParallelCoordinates, df, mo, vs): _indices = sorted(int(sid.split("_")[1]) for sid in _selected) _filtered_df = df[_indices] _par = ParallelCoordinates(_filtered_df, color_by="label", color_map=LABEL_COLORS) - mo.vstack([ - mo.md(f"**{len(_indices)}** points selected in 3D view"), - mo.ui.anywidget(_par), - ]) + mo.vstack( + [ + mo.md(f"**{len(_indices)}** points selected in 3D view"), + mo.ui.anywidget(_par), + ] + ) else: mo.md("*Lasso or box-select points in the 3D view to filter*") return @@ -258,11 +261,7 @@ def _(LABEL_COLORS, idx, images, label_names, labels, np, plt, vs, widget): _selected_ids = set(vs.widget.selected_points or []) _filtered = widget.widget.filtered_indices - _show = ( - [_i for _i in range(len(idx)) if f"p_{_i}" in _selected_ids][:10] - if _selected_ids - else list(_filtered[:10]) - ) + _show = [_i for _i in range(len(idx)) if f"p_{_i}" in _selected_ids][:10] if _selected_ids else list(_filtered[:10]) _sample_idx = np.array(_show) if len(_show) > 0 else np.array([0])