Skip to content

Refactor BasePlot not to create a dataframe representation of the data #3718

Description

@ilan-gold

What kind of feature would you like to request?

Additional function parameters / changed functionality / changed defaults?

Please describe your wishes

See #3717 for what prompted me to look at this code.

Currently BasePlot creates a in-memory copy as a dataframe of the main data of interest (obsm, X, layers etc.):

self.categories, self.obs_tidy = _prepare_dataframe(
adata,
self.var_names,
groupby,
use_raw=use_raw,
log=log,
num_categories=num_categories,
layer=layer,
gene_symbols=gene_symbols,
)

I believe this to be unnecessary as this dataframe is only ever used for groupby operations, for which we have a zero-copy solution in https://scanpy.readthedocs.io/en/latest/generated/scanpy.get.aggregate.html

Thus we should

Activity

  1. added
    good first issue
    on Jul 18, 2025
  2. modified the milestones: 1.12.0, 1.11.4 on Jul 18, 2025
  3. dorzhey commented on Jul 29, 2025

    @dorzhey

    I'd like to work on this issue, will submit a PR soon.

  4. ilan-gold commented on Jul 29, 2025

    @ilan-gold
    ContributorAuthor

    wooo great thanks @dorzhey !

  5. modified the milestones: 1.11.4, 1.11.6 on Oct 21, 2025
  6. modified the milestones: 1.11.6, 1.12.0 on Nov 10, 2025
  7. modified the milestones: 1.12.0, 1.13.0 on Jan 23, 2026
  8. srikarjy commented on Aug 6, 2026

    @srikarjy

    Hi @ilan-gold @flying-sheep noticed this has bounced across a few milestones and doesn't currently show a linked PR. Is this still something you'd want a contribution on, given the _v2/holoviz plotting work in progress? Happy to pick it up if so, or take a pointer elsewhere if this one's lower priority now.

  9. flying-sheep commented on Oct 2, 2026

    @flying-sheep
    Member

    Ah sorry for no reaction. We still take contributions. The plan is that the old plotting module becomes a very lightly maintained extra package at some point

  10. modified the milestones: 1.13.0, 1.14.0 on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area - Plotting 🌺Area – Performance 🐌good first issue

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions