From f036b4466e5d4e98782390ff978f658624cc84e8 Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Tue, 9 Jul 2024 10:28:07 +0200 Subject: [PATCH] Fix cpu count detection (#527) * Update __init__.py * Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ src/scirpy/util/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffd959aad..04911ccd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning][]. [keep a changelog]: https://keepachangelog.com/en/1.0.0/ [semantic versioning]: https://semver.org/spec/v2.0.0.html +## v0.17.2 + +### Fixes + +- Detection of CPU count in `define_clonotype_clusters` was broken ([#527](https://github.com/scverse/scirpy/pull/527)) + ## v0.17.1 ### Fixes diff --git a/src/scirpy/util/__init__.py b/src/scirpy/util/__init__.py index 01283b43e..0a4059351 100644 --- a/src/scirpy/util/__init__.py +++ b/src/scirpy/util/__init__.py @@ -598,6 +598,6 @@ def _get_usable_cpus(n_jobs: int = 0): return n_jobs try: - return os.sched_getaffinity(0) + return len(os.sched_getaffinity(0)) except AttributeError: return os.cpu_count()