Skip to content

Bug: transfunc has inconsistent/broken behavior across render methods #582

Description

@timtreis

Description

transfunc (passed via **kwargs) has inconsistent and partially broken behavior across the three element rendering methods:

render_points — correct

  • Applied when color_source_vector is None (continuous data)
  • Receives raw numeric values before colormap mapping
  • Use case: np.log1p, np.sqrt etc. on expression values

render_shapesinverted condition (bug)

  • Applied when values_are_categorical is True (render.py ~line 396)
  • At that point color_vector is a pd.Categorical of hex color strings like "#FF0000FF"
  • Calling a numeric transform on hex strings is nonsensical and will either crash or silently corrupt the color vector
  • The condition should be flipped to match points: apply only for continuous data

render_labelsdead code

  • Extracted from kwargs and stored in LabelsRenderParams.transfunc
  • _render_labels() never reads render_params.transfunc
  • Parameter is silently accepted but has zero effect

Expected behavior

All three methods should match render_points: apply transfunc to raw numeric values when coloring by continuous data, and ignore it for categorical data.

Found during

Docstring & parameter audit for #463.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions