Fix Python 3.13 failures in neighborhood enrichment and AnnData test fixture - #120
Open
marcovarrone with Copilot wants to merge 2 commits into
Open
Fix Python 3.13 failures in neighborhood enrichment and AnnData test fixture#120marcovarrone with Copilot wants to merge 2 commits into
marcovarrone with Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job Python 3.13
Fix Python 3.13 failures in neighborhood enrichment and AnnData test fixture
Jul 26, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #120 +/- ##
==========================================
- Coverage 68.00% 67.78% -0.23%
==========================================
Files 23 23
Lines 1638 1639 +1
==========================================
- Hits 1114 1111 -3
- Misses 524 528 +4
🚀 New features to boost your workflow:
|
marcovarrone
marked this pull request as ready for review
July 26, 2026 15:21
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.
The Python 3.13 Actions job failed due to two dependency-compatibility regressions:
AnnData(..., dtype=...)in tests and in-place diagonal writes on read-only DataFrame-backed arrays. This PR updates both paths to be compatible with currentanndata/numpybehavior while preserving existing semantics.Neighborhood enrichment diagonal handling (
src/cellcharter/gr/_nhood.py)np.fill_diagonal(... .values, np.nan)with DataFrame-level masking to avoid mutating potentially read-only backing arrays.only_inter=Truebehavior (diagonal set toNaN) unchanged.AnnData fixture compatibility (
tests/conftest.py)dtypeargument fromAnnData(...).np.array(..., dtype=int)).Regression coverage (
tests/graph/test_nhood_local.py)nhood_enrichment(..., only_inter=True, observed_expected=True)returnsNaNdiagonals for observed/expected/enrichment.