Skip to content

perturbation_space: skip None-keyed layers in _combine#1000

Merged
Zethson merged 1 commit into
mainfrom
fix/combine-none-layer-key
May 26, 2026
Merged

perturbation_space: skip None-keyed layers in _combine#1000
Zethson merged 1 commit into
mainfrom
fix/combine-none-layer-key

Conversation

@Zethson
Copy link
Copy Markdown
Member

@Zethson Zethson commented May 26, 2026

Summary

  • sc.get.aggregate can leave a None-keyed layer on the returned AnnData.
  • PseudobulkSpace.compute already strips it (added in fix ci #976), but the _combine refactor in perturbation_space: cleanup, safer defaults, kill stale-state bugs #994 introduced key.endswith("_control_diff") calls that crash on a stray None key — which is what the CI failure on test_linear_operations was hitting.
  • Filter to string keys before doing the string ops and the iteration that builds the new AnnData, with a comment so this doesn't regress next time someone touches _combine.

sc.get.aggregate can leave a None-keyed layer on the AnnData it returns; PseudobulkSpace.compute strips it, but the _combine refactor in #994 added `key.endswith("_control_diff")` calls that crash on a stray None key (e.g. when callers hand-build the input).
Filter to string keys before doing the string ops and the iteration that builds the new AnnData.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label May 26, 2026
@Zethson Zethson merged commit f52cb99 into main May 26, 2026
17 of 19 checks passed
@Zethson Zethson deleted the fix/combine-none-layer-key branch May 26, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant