-
Notifications
You must be signed in to change notification settings - Fork 52
Xenium avoid calling get_element_instances(); fix deprecation warning
#369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #369 +/- ##
==========================================
- Coverage 63.08% 62.85% -0.23%
==========================================
Files 27 27
Lines 3153 3158 +5
==========================================
- Hits 1989 1985 -4
- Misses 1164 1173 +9
🚀 New features to boost your workflow:
|
… metadata; remove deprecaction warning
get_element_instances(); fix deprecation warning
|
Good catch @LucaMarconato ! What do you think about adding a |
|
Yes I would expect the behavior like what you describe. I did some experiments and the memory indeed decreases, but there is still quite some peak usage, probably because of some rechunking operations involved beforehand. I could optimize this further and expose the parameters, but since If for some reasons this data turns out to be less rare than anticipated, or if the fallback code is needed for other reasons, I'd be open to have the behavior you described implemented. |
|
Unreleated failing: scverse/spatialdata#1065. Will be fixed later today with a pre-release. |
|
Turns out the offending compute was somewhere else! Here is the culprit: https://github.com/spatial-image/multiscale-spatial-image/blob/6217a331d3e0897dcb1d857086f68a6ab2a50f72/multiscale_spatial_image/to_multiscale/_dask_image.py#L196 The latest |
|
Considerations about the |
This PR scverse/spatialdata#1068 fixes the above and leads to a massive performance improvement. |
get_element_instances()when the info is present in the metadata.@marcovarrone I noticed that even after #337 the memory usage was not great. This was due to remaining calls of
compute()(called twice) viaget_element_instances(). For somexeniumversion (some prototype versions right after 2.0.0 was released) it may be more difficult to avoid such call, but for newer Xenium version there is a massive performance boost. I will do systematic benchmarks soon, but I anticipate a 95% decrease in peak memory and some modest time improvement as well.