Skip to content

Support .obsm backed color specs in val.viz.embedding#97

Open
JhonatanFelix wants to merge 7 commits intopatcon:mainfrom
JhonatanFelix:main
Open

Support .obsm backed color specs in val.viz.embedding#97
JhonatanFelix wants to merge 7 commits intopatcon:mainfrom
JhonatanFelix:main

Conversation

@JhonatanFelix
Copy link
Copy Markdown

@JhonatanFelix JhonatanFelix commented Apr 14, 2026

Summary

Closes #55

This draft PR is meant to cover a small V1 for supporting .obsm-backed color specs in val.viz.embedding

Planned scope for this work:

  • Parser / expansion

    Add private parsing and expansion helpers for color specs like foo[2] and bounded slices like foo[2:6] while keeping normal .obs keys unchanged.

  • val.viz.embedding wrapper

    Replace the current direct re-export with a small wrapper that resolves .obsm vector specs, creates temporary .obs columns on a copy of adata, and then forwards the rewritten color argument to scanpy.pl.embedding.

  • Tests and polish

    Add focused unit tests for the parsing and wrapper behavior and plus a small smoke test to make sure the feature works end-to-end without mutating the original adata.

For this V1, I’m intentionally keeping the scope pretty "small":

  • support foo[i]
  • support bounded slices like foo[a:b]
  • allow mixing these with normal .obs color keys
  • leave foo[:] out for now

Checklist

  • CHANGELOG.md updated under [Unreleased] (required for user-facing changes)
  • Tests added or updated if needed
  • Docs updated if needed

@JhonatanFelix JhonatanFelix marked this pull request as ready for review April 14, 2026 15:54
@patcon
Copy link
Copy Markdown
Owner

patcon commented Apr 14, 2026

thanks! will aim to review today, though maaaaybe tomorrow 🙏

@JhonatanFelix
Copy link
Copy Markdown
Author

Hi @patcon, I wanted to follow up on this PR in case it got buried
Happy to make any adjustments if needed!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set plot colors from .obsm["X_foo"] vectors via "X_foo[0]" syntax

2 participants