Extend make_palette_from_data to support labels#670
Merged
Conversation
Labels (raster) elements have no per-pixel column, so the categorical column always lives on the linked AnnData table. Dispatch through _get_labels_from_table for the labels case; broaden the KeyError to list labels in the available-elements set.
Drop hand-rolled _build_labels_sdata / labels_sdata fixture. sdata_blobs already provides blobs_labels with a linked table; add the categorical cell_type column on the table directly, matching the existing pattern in test_render_labels.py.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #670 +/- ##
==========================================
+ Coverage 77.61% 77.63% +0.01%
==========================================
Files 11 11
Lines 3610 3612 +2
Branches 849 850 +1
==========================================
+ Hits 2802 2804 +2
Misses 485 485
Partials 323 323
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make_palette_from_datapreviously raisedKeyErrorfor labels (raster) elements — the error message itself flagged it as a known TODO._resolve_elementnow dispatches labels through_get_labels_from_table(labels have no per-pixel column; the categorical column always lives on the linked AnnData table).KeyErroravailable-elements set extended to includesdata.labels; obsolete "not yet supported" note removed.make_palette_from_dataupdated to mention labels and clarify the shapes/points-vs-labels lookup rules.Closes #662