Skip to content

Commit dc43a36

Browse files
committed
refactor(render): delete _filter_groups_transparent_na + _maybe_apply_transfunc (#700)
Both are now dead — the renderers' groups-filter and transfunc go through ColorSpec.filter / .apply_transfunc. Real subtraction.
1 parent 6893a37 commit dc43a36

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

src/spatialdata_plot/pl/render.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -276,33 +276,6 @@ def _warn_groups(
276276
_warn_missing_groups(groups, color_source_vector, col_for_color)
277277

278278

279-
def _maybe_apply_transfunc(
280-
colortype: ColorType,
281-
color_vector: Any,
282-
transfunc: abc.Callable[[Any], Any] | None,
283-
) -> Any:
284-
"""Apply ``transfunc`` to a continuous ``color_vector``; no-op when categorical/none or unset."""
285-
if colortype == "continuous" and transfunc is not None:
286-
return transfunc(color_vector)
287-
return color_vector
288-
289-
290-
def _filter_groups_transparent_na(
291-
groups: str | list[str],
292-
color_source_vector: pd.Categorical,
293-
color_vector: pd.Series | np.ndarray | list[str],
294-
) -> tuple[np.ndarray, pd.Categorical, np.ndarray]:
295-
"""Return a boolean mask and filtered color vectors for groups filtering.
296-
297-
Used when ``na_color=None`` (fully transparent) so that non-matching
298-
elements are removed entirely instead of rendered invisibly.
299-
"""
300-
keep = color_source_vector.isin(groups)
301-
filtered_csv = color_source_vector[keep]
302-
filtered_cv = np.asarray(color_vector)[keep]
303-
return keep, filtered_csv, filtered_cv
304-
305-
306279
def _split_colorbar_params(
307280
params: dict[str, object] | None,
308281
) -> tuple[dict[str, object], dict[str, object], str | None]:

0 commit comments

Comments
 (0)