From 7175929f4708faef7f93580ef55aa0be4d419052 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Sat, 4 Jun 2022 11:00:28 +0100 Subject: [PATCH] LookupNdBuilder: second try to fix CI --- navis/nbl/smat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/navis/nbl/smat.py b/navis/nbl/smat.py index 5b1430ce..69233f8f 100644 --- a/navis/nbl/smat.py +++ b/navis/nbl/smat.py @@ -306,6 +306,11 @@ def _get_pairs(self): return matching_pairs, nonmatching_pairs def _build(self, threads, cache=False) -> Tuple[List[Digitizer], np.ndarray]: + # Asking for more threads than available CPUs seems to crash on Github + # actions + if threads and threads >= cpu_count: + threads = cpu_count + if self.digitizers is None and self.bin_counts is None: raise ValueError( "Builder needs either digitizers or bin_counts; see with_* methods" @@ -362,11 +367,6 @@ def build(self, threads=None, cache=False) -> LookupNd: ------- LookupNd """ - # Asking for more threads than available CPU seems so crash on Github - # actions - if threads and threads >= cpu_count: - threads = cpu_counts - dig, cells = self._build(threads, cache) return LookupNd(dig, cells)