Fix import of removed scanpy _get_obs_rep/_set_obs_rep - #1050
Merged
Conversation
scanpy 1.13.0a1 removed the private helpers scanpy.get._get_obs_rep and scanpy.get._set_obs_rep, breaking `import pertpy`. These helpers only resolved X vs a named layer, which AnnData now handles directly, so replace them with direct adata.X / adata.layers access. Fixes #1049 Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1050 +/- ##
=======================================
Coverage 78.76% 78.77%
=======================================
Files 51 51
Lines 7167 7170 +3
=======================================
+ Hits 5645 5648 +3
Misses 1522 1522
🚀 New features to boost your workflow:
|
The pooch migration (#980) dropped the retry-with-backoff loop that the previous _download had, leaving max_retries/retry_delay as dead params. Transient failures such as 'Connection reset by peer' (URLError, an OSError subclass) or a requests ConnectionError therefore aborted the download immediately, causing flaky test failures on CI. Reinstate the retry loop around pooch.retrieve, retrying on OSError and requests.exceptions.RequestException with a delay between attempts, and add unit tests covering the retry, exhaustion, and non-transient paths. Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
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.
Description
scanpy 1.13.0a1 removed the private helpers
scanpy.get._get_obs_repandscanpy.get._set_obs_rep, which brokeimport pertpywith:These helpers only resolved
Xvs a named layer, which AnnData handles directly (andplot_heatmapin the same file already did inline).This replaces the imports with direct
adata.X/adata.layers[...]access.Fixes #1049
Testing
tests/preprocessing/test_grna_assignment.pypasses (23 passed).