chore: unify thread and process helpers - #1251
Open
selmanozleyen wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1251 +/- ##
==========================================
+ Coverage 77.24% 77.36% +0.11%
==========================================
Files 63 63
Lines 9378 9392 +14
Branches 1579 1580 +1
==========================================
+ Hits 7244 7266 +22
+ Misses 1532 1528 -4
+ Partials 602 598 -4
🚀 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.
This pull request refactors how the number of parallel workers is determined throughout the codebase. It deprecates the old
_get_n_coresutility in favor of a newget_n_processesfunction for process-based parallelization and introducesget_n_threadsfor numba-based threading. All relevant imports and function calls are updated to use the new functions, ensuring more consistent and descriptive handling of parallelism.Parallelization utilities refactor:
get_n_threadstosrc/squidpy/_utils.pyfor resolving numba thread counts, and replaced_get_n_coreswithget_n_processes, which is now used for process-based parallelization and is marked as deprecated in favor of numba threading where appropriate._get_n_corestoget_n_processesin the following modules:src/squidpy/experimental/im/_tiling.py,src/squidpy/gr/_ligrec.py,src/squidpy/gr/_nhood.py,src/squidpy/gr/_ppatterns.py,src/squidpy/gr/_sepal.py, andsrc/squidpy/im/_feature.py. [1] [2] [3] [4] [5] [6]_get_n_coreswithget_n_processesfor determining the number of worker processes or threads in parallel computations. [1] [2] [3] [4] [5] [6] [7]get_n_processesconvention and clarify its intended usage and deprecation plan.These changes standardize parallelization configuration, improve code clarity, and prepare the codebase for future migration to numba threading.